MODEL PIPELINE
From raw census to published probability
Census profiles
ACS 5-year estimates by congressional district for 2012–2024 from the Census Bureau API, each release paired with the House election fought on the same lines (fetch_acs.py, build_dataset.py).
Results
House and Senate results and the national House popular vote from FiveThirtyEight's election-results (national.py).
Model
XGBoost and a two-stage Ridge-plus-trees learner, blended; chosen by blind backtest Brier score (train_backtest.py, structural.py).
2026 maps
Nine redrawn states rebuilt from census tracts and 2020 blocks with the Census 120th Congress block file; boundaries from TIGER 2026 (redistrict.py, build_geometry_2026.py).
Senate
District margins averaged by state, state error measured on 2014–2024 Senate races (senate.py).
Publish
One JSON file for the site; every number on these pages comes from it (export_web.py).