Skip to main content

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


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)

Uploaded Source

Built Distribution

MLVRAtests-0.1.0-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page