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.

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 exampleESPN Fantasy Football with IBM WatsonIBM 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 exampleESPN boom and bust classificationsThe 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 examplenflfastR modelsThe 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 exampleNFL Big Data BowlThe 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 pandasLoad weekly stats from nflverse, join tables and compute rolling averages of targets, carries and snaps.Learn it in Data Tools
  2. Statistics and uncertaintyLearn variance, regression to the mean and prediction intervals, because weekly fantasy scores are very noisy.Learn it in Statistics
  3. Regression modelsFit ridge regression and gradient boosting to predict next-week points, and compare against a simple recent-average baseline.Learn it in Machine Learning
  4. Backtesting by weekTrain 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 workFootball 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.

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.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.