Set of tools to measure and test for violations of the 1982 Voting Rights Amendment
Project description
Machine Learning Voting Right Act Tests
Centernoid X-Symetry
Uses weighted centernoid and K-Mean Clustering to determin the compactness of a district by mesuring the distance from Geographic Center and Boundry
weighted_centroind(df, District_ID, GEOID='GEOID20', Population='POP100', Lat='INTPTLAT20', Lon='INTPTLON20', dist_geo='geometry')
kmean_xSymetry(df, district_id, pop, lat, lon, geoid, district_geometry)
Ecological Inference
Uses Elecologic Ingernce Model from King 1999 using a default covariate as target vote share and lmbda as 0.5 to match what was writen in King's Paper
ecological_inference(Total_Population_Col, Target_Population_Col,
Target_Vote_Share_Percentage, covariate=None, lmbda=0.5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
MLVRAtests-0.1.0.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for MLVRAtests-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59de49aaf87a15c12b53d11c8816a326d987767cea0ef90e364659cfc432d561 |
|
MD5 | c5457e64161dff7a8961c4fd6df12b0b |
|
BLAKE2b-256 | 44b14de20610da732e3180c3dbc63063a60e87bef7ad3e9d499d6655628acad1 |