← Sam Mozer
NFL play prediction
Given the situation on the field, can a model guess the next play call? I built one in Keras and wrote it up on Medium.
- Role
- Solo project
- Result
- 73% accuracy, 4 play types
- Stack
- Python · Keras · TensorFlow · scikit-learn
The model
16 game-situation features
down · distance · field position · quarter · time left in half
score differential · win probability · TD / FG / safety probability
drive · week · month · offensive coach · defense
│ scaled with StandardScaler; coach and defense label-encoded
▼
LSTM (32) → dropout 0.2 → LSTM (16) → dropout 0.2
│
▼
softmax over 4 play types: pass · run · field goal · punt
- Data. NFL play-by-play data, cleaned to remove kneels, no-plays, and rows missing down or win probability, then filtered to the four play types.
- Training. Adam optimizer with categorical cross-entropy for 50 epochs, holding out a test set. Test accuracy came out around 73%. A seven-class version (with more play types) reached just over 50%.
What the errors showed
Field goals and punts were almost always right: fourth down, distance, and field position nearly decide them. Nearly all of the mistakes were pass versus run, and the model leaned toward predicting pass. That's the call that actually matters to a defense, and the one where game situation alone runs out of information.