To develop a real-time predictive Machine Learning model and dashboard that can:
- Analyze tracking data on a 0.1-second level
- Estimate the probability of QB pressure based on player movement
- Visualize pressure likelihood during live plays
NFL coaches care about pressure situations because they directly impact QB performance. This tool (made for demostration and learning purposes only) was developed to quantify and explore how likely a QB is to be pressured in real-time can help evaluate O-line performance, design plays that minimize pressure risk, and assess defensive effectiveness.
Currently, this project has achieved a working, real-world ML model, unlocking football ops-relevant logic. Below is a table of all completed and in-progress components.
| Component | Progress |
|---|---|
| Data Loading & Management | ✅ Loads play-by-play and granular tracking data for ~3,383 plays, can be scaled for more weeks ✅ Modular loading for all raw datasets (tracking, players, games, plays) |
| Feature Engineering | ✅ Distance to QB computed per player, per frame ✅ Play-level aggregates (min, mean, std distance, max speed) |
| Label Generation (Pressure Events) | ✅ Conservative heuristic applied (1.0 yard, 2.0s) ✅ Achieved better class balance (3308 pressure / 75 no-pressure) |
| Model Training & Evaluation | ✅ Successfully trained LogisticRegression and XGBoost✅ Models now recognize both pressure and no-pressure classes ✅ Precision for “No Pressure” ~0.80 in latest run |
| Testing Infrastructure | ✅ Modularized test files: test_features.py, test_labeling.py, test_model.py✅ Output logs show feature counts, label breakdown, and metrics |
| Scalability & Next Steps Planning | ✅ Ready to ingest more data (Weeks 4–8) |
| Model Deployment/Visualization | 🚧 Not started yet Potential: Streamlit dashboard, Matplotlib visualizations, real-time prediction |
qb-pressure-tracker/
│
├── data/ # Raw and processed datasets
│ ├── raw/ # Original NFL datasets
│ └── processed/ # Cleaned and feature-engineered data
│
├── notebooks/ # Jupyter notebooks for exploration and modeling
│ ├── 01_data_cleaning.ipynb
│ ├── 02_feature_engineering.ipynb
│ └── 03_model_training.ipynb
│
├── src/ # Source code
│ ├── data_loader.py # Data loading functions
│ ├── feature_utils.py # Feature engineering helpers
│ ├── model.py # Model training and inference
│ └── visualization.py # Visualization utilities
│
├── app/ # Dashboard or deployment code (Streamlit, etc.)
│ └── dashboard.py
│
├── tests/ # Unit tests for code modules
│ ├── test_features.py # Tests feature engineering (distance to QB)
│ ├── test_labeling.py # Tests labeling logic (pressure events)
│ └── test_model.py # Test model training and evaluation
│
├── README.md # Project overview and setup
├── requirements.txt # Python dependencies
└── .gitignore
- Distance and speed between QB and nearest defenders
- Directional angles of approach
- QB time-to-throw and initial positioning
- Play context (down, distance, formation, etc.)
- Data Cleaning – Load and preprocess tracking + play-by-play data
- Feature Engineering – Extract time-series features on 0.1s intervals
- Modeling – Train a classifier (e.g., XGBoost) to predict pressure events
- Deployment – Display results in a simple web interface (e.g., Streamlit)
git clone https://github.com/yourusername/qb-pressure-tracker.git
cd qb-pressure-tracker
pip install -r requirements.txtstreamlit run app/dashboard.py