CoolFace
Modelpublic

SebastianAndreu/2025-24679-NFL-Yards-Predictor

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
Model Card

๐Ÿง  Model Card: Walk-Forward AutoGluon Model (By Week)

๐Ÿ“˜ Overview

This model performs walk-forward training and evaluation for predicting NFL wide receiver (WR) receiving yards on a week-by-week basis using AutoGluonโ€™s TabularPredictor. It leverages historical player embeddings, pregame contextual features, and weather/game metadata to iteratively train and test within each NFL season (2016โ€“2025).


๐Ÿงฉ Model Details

Model Type: Walk-forward regression (AutoGluon TabularPredictor) Framework: AutoGluon Tabular Author: Sebastian Andreu License: MIT Primary Use: Predicting receiving_yards for each wide receiver before a game is played.

Key Idea

Instead of training one global model, this script re-trains weekly within each season, always using all prior weeks as training data and the next week as the test set. This ensures realistic forward-looking performance without data leakage.


โš™๏ธ Data

Source Datasets

The model loads and concatenates season datasets from:

SebastianAndreu/24679_NFL_WR_Dataset_<YEAR>

for 2016 โ‰ค YEAR โ‰ค 2025.

Each dataset includes pregame features such as weather, team matchup, and Vegas lines.

Features Used

Pregame input variables:

  • โ€”defteam
  • โ€”posteam
  • โ€”surface
  • โ€”is_dome
  • โ€”is_rain
  • โ€”is_snow
  • โ€”is_clear
  • โ€”temp_f
  • โ€”humidity_pct
  • โ€”wind_mph
  • โ€”home_team
  • โ€”away_team
  • โ€”pregame_spread
  • โ€”pregame_total
  • โ€”passer_player_id
  • โ€”receiver_player_id

The dataset is also merged with `player_historical_embeddings.csv`, which provides dense numerical representations of player histories.

Target Variable

receiving_yards โ€” the number of receiving yards gained by the WR in the upcoming game.


๐Ÿงฎ Training Procedure

Walk-Forward Logic

For each season:

  1. 1.Extract the total number of weeks in that season.
  2. 2.For each week W starting from 2:
  • โ€”Train on data from weeks < W.
  • โ€”Test on data from week W.
  • โ€”Train a new AutoGluon model from scratch (10-minute time limit).
  • โ€”Collect predictions and evaluation metrics.

AutoGluon Configuration

python
TabularPredictor(
    label="receiving_yards",
    path=model_dir,
    verbosity=0
).fit(
    train_data=train[features + [target]],
    time_limit=600,
    presets="medium_quality_faster_train"
)

Time Limit: 600 seconds per week Preset: medium_quality_faster_train Verbosity: 0 (minimal logging)


๐Ÿ“Š Evaluation

Metric

The model computes Mean Absolute Error (MAE) over all weekly predictions.

Output

After all walk-forward runs:

  • โ€”walkforward_predictions.csv โ€” contains true vs. predicted values per week.
  • โ€”Columns:
  • โ€”season
  • โ€”week
  • โ€”true
  • โ€”pred
  • โ€”error = |true - pred|

Example final output:

โœ… Walk-forward complete!
Total predictions: 3,200
Mean Absolute Error: 12.47
๐Ÿ“ฅ Saved: walkforward_predictions.csv

๐Ÿ“ข Artifacts

ArtifactDescription
player_historical_embeddings.csvPrecomputed player embeddings
autogluon_walkforward/Directory of trained weekly models
walkforward_predictions.csvAggregated results of predictions
SebastianAndreu/24679_NFL_WR_Dataset_<YEAR>Input datasets (2016โ€“2025)

๐Ÿง  Intended Use

Goal: Predict individual WR performance before each NFL game. Primary Users: Sports analytics researchers, fantasy football data scientists, and betting modelers. Not intended for: Real-time in-game prediction or commercial wagering advice.


โš ๏ธ Limitations

  • โ€”Training each week from scratch is computationally expensive.
  • โ€”Does not include injury or roster change data.
  • โ€”Embeddings rely on prior model quality (player_historical_embeddings.csv).
  • โ€”Accuracy varies across early vs. late season due to data availability.

๐Ÿงฉ Future Improvements

  • โ€”Incorporate transfer learning between seasons.
  • โ€”Add injury & snap count features.
  • โ€”Experiment with AutoGluon ensemble distillation to reduce retraining cost.
  • โ€”Combine with Model 1 embeddings pipeline for joint optimization.