This project predicts what an NFL coach is likely to call on 4th down — punt, field goal, or go for it — based on game situation context (distance, field position, score, quarter, game clock, season) plus the offensive coach. It includes an interactive Streamlit app that outputs P(go) and a “coach effect” vs a baseline.
The app takes:
- Yards to go (
ydstogo) - Field position (
yardline_100) - Quarter
- Score differential (Offense − Defense; + means offense leads)
- Game clock (minutes:seconds remaining)
- Season
- Offensive coach
It outputs:
- Coach likelihood: P(go), P(punt), P(field_goal)
- Coach effect vs baseline: coach P(go) − baseline P(go)
- Optional expanders:
- League tendency (situation-only model)
- Value benchmark (expected WPA by action; exploratory)
Trained on 2016–2022 and evaluated on 2023–2024 (neutral situations):
- Accuracy: 0.8796
- Macro F1: 0.8339
- Log loss: 0.3217
NFL play-by-play data (2016–2024) is cached locally as a parquet file: data/pbp_2016_2024.parquet.
Neutral situation filter (used for modeling & scorecards):
- Quarter: Q2–Q4
- Time remaining: > 2:00
- Score differential: within ±10
The app can still be used outside of neutral situations, but it shows a warning because predictions may be less reliable.
py -m venv .venv
.\.venv\Scripts\Activate.ps1pip install -r requirements.txt.\run_all.ps1.\run_app.ps1