Skip to content

The complete collection of BPR's code, data, and visualizations for our 2024 election model

License

Notifications You must be signed in to change notification settings

BPR-Data-Team/ElectionModel2024

Repository files navigation

24cast.org Model Repository

The complete collection of BPR's code, data, and visualizations for our 2024 election model.

If you're looking for the codebase for our website, click here.


Our goal is to ensure any person who wants to re-run our model or understand the underlying math behind it can do so as easily as possible. As such, we have included a README within each directory that explains the contents of that directory.

See Git Guide.md for instructions on how to clone the repository and contribute to the project

See the Data folder for all non-cleaned data. All of this data has a cleaned counterpart in Cleaned Data.

See the Code folder for all cleaning, scraping, and model code.

See Models folder for a brief description of how to de-serialize and analyze the actual models we used.

See Data Citations.md for disclosures of authorship on the data we use.

Archive contains old code and models that are defunct.

Check out our GitHub Workflows to see how we update our data daily and subsequently create new predictions.


See how to install a virtual environment in the root directory of the project for working on Python files

1. From the root directory of the project, run the following command in your terminal to install a virtual environment:

python3 -m venv venv

This will create a new folder called venv in the root directory of the project. This folder will contain all of the dependencies for the project. This is a one-time step. You will not need to install a virtual environment again. This folder is ignored by Git, so it will not be tracked by the repository.

2. Activate the virtual environment:

source venv/bin/activate

Do this each time you start working on the project. You will know that the virtual environment is active when you see (venv) at the beginning of your terminal prompt. You can deactivate the virtual environment at any time by running the following command:

deactivate

3. Install the project's dependencies:

pip install -r requirements.txt
See how to create an .env file with the required API keys if you want to run data_fetcher.py

1. Create a copy of the .env.example file and rename it to .env:

cp .env.example .env

2. Fill in the required API keys in the .env file:

# .env
FRED_API_KEY=your_fred_api_key

You can either get your own API keys or ask a member of the team for the keys.

About

The complete collection of BPR's code, data, and visualizations for our 2024 election model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published