Images, language and games

Machine learning for fantasy football

Machine learning for fantasy football forecasts each player's points for the coming week from recent usage, opponent and team context. The forecasts feed start or sit choices, waiver rankings and draft values, with prediction ranges to show risk.

Where to start

Learn to build features from information available before each game, such as rolling averages of targets, carries and snaps. Then compare regression models with a simple recent-average baseline on a later season.

How machine learning is used in fantasy football

Projecting weekly player points

Regression models predict each player's fantasy points from recent usage, opponent and team context. A projection with a range is more useful than a single number for start or sit decisions.

Real example: ESPN Fantasy Football with IBM Watson. IBM researchers describe a pipeline that combined deep learning outputs with ESPN projection data to give a point projection for the top 500 or more fantasy players in 2018.

Reading news and injury reports

Language models scan news, blogs and podcasts for signals about role, health and opportunity that box scores miss. The signals become features for player classifications.

Real example: ESPN boom and bust classifications. The same IBM work used entity detection and document vector models on millions of articles, videos and podcasts to classify players as likely boom, bust or playing with a hidden injury.

Play-level expected points models

Models estimate the expected points and win probability of every play from down, distance and field position. Expected points added per play is a widely used measure of player and team efficiency.

Real example: nflfastR models. The open-source nflfastR expected points, win probability and completion probability models are trained with xgboost on play-by-play data.

Player tracking metrics

Tracking data records every player's position many times per second, which supports metrics such as separation and route patterns. Public competitions open this data to analysts.

Real example: NFL Big Data Bowl. The NFL's Big Data Bowl, hosted on Kaggle and powered by AWS, challenges participants to build metrics from NFL player tracking data.

Can you learn machine learning for fantasy football?

Yes, and it is a motivating first project because the data is free and the results are tested every week. Learn Python and pandas, then statistics and regression, then honest backtesting on past seasons.

  1. Python and pandas. Load weekly stats from nflverse, join tables and compute rolling averages of targets, carries and snaps. Taught in the Data Tools track of Foundations of AI
  2. Statistics and uncertainty. Learn variance, regression to the mean and prediction intervals, because weekly fantasy scores are very noisy. Taught in the Statistics track of Foundations of AI
  3. Regression models. Fit ridge regression and gradient boosting to predict next-week points, and compare against a simple recent-average baseline. Taught in the Machine Learning track of Foundations of AI
  4. Backtesting by week. Train only on past weeks and test on the next one, so the evaluation matches how you would use the model.

From fantasy player to football data analyst

If you already work in the field

If you already play fantasy football seriously, you understand usage, matchups and news better than most beginners in data. Learn Python and regression, then rebuild a projection you already make by hand and measure it against last season.

If you come from data science or ML

If you come from data science, learn football's structure: roles, snap counts, game scripts and scoring formats. Read public analytics work such as nflfastR and Big Data Bowl entries to see which features matter.

Roles that do this work: Football data analystSports data scientistFantasy sports analystQuantitative analyst, sports

Tools you will use

ToolWhat you use it for
nflreadpyLoad nflverse play-by-play, weekly player stats, rosters and schedules into Python.
pandasBuild rolling, dated player features without leaking information from future games.
scikit-learnFit ridge regression and other models with time-ordered cross-validation.
LightGBMGradient-boosted trees for nonlinear player forecasts, with quantile objectives for prediction ranges.

Public data to practise on

  • nflverse data: Open NFL play-by-play, weekly player stats and rosters published as files, for forecasting player output.

Your first project

Download nflverse weekly player stats, predict each player's next-week fantasy points with ridge regression on rolling averages, and compare it with a last-three-games average using mean absolute error on a later season.

Keep the result, your code and a short note on what didn't work. That record is worth more than the score.

Common questions

Can machine learning win my fantasy league?
It can make your projections more consistent and less biased, but weekly scores are very noisy and luck plays a large part. Treat a model as one input with its uncertainty.
Where can I get free NFL data?
nflverse provides free play-by-play, weekly player stats and rosters, which you can load in Python with nflreadpy.
Which model works best for fantasy projections?
Regularised linear models and gradient boosting on rolling usage features are strong starting points. Always compare with a simple average of recent games.

First Principles, the SchoolWhool newsletter

One machine learning idea, explained properly, every week.

The intuition, the common mistake, and a five-minute way to try it yourself. Written by Gaurav.

Learn the machine learning behind it, from first principles.

Start with Python from zero, free. Every stage after that builds on the last, and a person answers your doubts.