Skip to content

datapinions/evlcharts

Repository files navigation

evlcharts

This project generates a series of impact charts that show the impact of race, demographics, and income on eviction rates.

The data set this project works with is generated by and described in the evldata project.

For more on impact charts in general, see the impactchart project.

Dependencies

The key binary requirements for this project are Python 3.11 or higher and GNU make. We test with Gnu make version 4.4, but other versions may work.

The Python requirements for the project are listed in requirements.txt and should all be installable in your virtual environment via

pip install -r ./requirements.txt

During development we use poetry to manage dependencies but we try to always keep the requirements.txt up to date.

Generating Charts

All feature engineering, model building, optimization, and impact chart generation is handled by a single Makefile. It is designed to generated impact charts in bulk across as many counties as it has the data to support.

By default, the impact charts end up in directories along paths like ./plots/renters/filing_rate/SSCCC where SS is a state FIPS code and CC is a county FIPS code. So, for example, impact charts for DeKalb County, Georgia are generated in ./plots/renters/filing_rate/13089.

Generating all the charts can take a while, but it can be parallelized. If you have multiple cores available, GNU make supports building several at one time. For example, on the ten-core machine I typically use, I run

gmake -j 8

to use 8 cores and build 8 charts at the same time, leaving me 2 cores to do other interactive work. You can adjust the number accordingly based on the hardware you have available.

Additional Options

The renters component in ./plots/renters/filing_rate/SSCCC indicates that the impact charts are for models built with the demographics of renters. If you prefer to build the models with the overall demographics of each tract, you can run

gmake -j 8 POPULATION=all

The results will be placed in ./plots/all/filing_rate/SSCCC`.

There are also two other eviction rates you have the option of using, instead of the default of eviction filing rate.

Use

gmake -j PREDICTION_Y=threatened_rate

to model the rate of threatened eviction instead of eviction filing.

Use

gmake -j PREDICTION_Y=judgement_rate

to model the rate of eviction judgements.

You can also use combinations of POPULATION= and PREDICTION_Y= to generate different combinations of results.

Note that not all data is avaialble for all counties, so the number of charts you get will vary depending on what combination of command-line arguments you give.

Charts for a Single County

Sometimes you don't care about building hundreds of charts for all the possible counties for which data is available. To build for just a single county, you can specify just the directory you want to build. For example, to build impact charts for DeKalb County, Georgia only, you would run

gmake plots/renters/filing_rate/13089

This approach can also be combined with compatible settings of POPULATION= and/or PREDICTION_Y=. For example,

gmake POPULATION=all plots/all/filing_rate/13089

I often use the -n option to gmake along with combinations of arguments like this to see what commands would be run. Once I like what I see, I take away the -n to run the commands and generate the charts.