Student Data Project: Build a Fantasy Football Stats Dashboard
data literacyproject-based learningsports analytics

Student Data Project: Build a Fantasy Football Stats Dashboard

UUnknown
2026-02-28
10 min read
Advertisement

Turn FPL data into a classroom project: build visualizations, predictive models, and a weekly tracker students can run.

Turn Fantasy Premier League (FPL) into a hands-on student data project — fast, weekly, and classroom-ready

Overwhelmed by too many methods, worried students will lose motivation, or unsure how to make statistics class feel relevant? This step-by-step project turns real FPL and Premier League data into an engaging, repeatable classroom experience: build visualizations, a predictive model, and a lightweight weekly tracker students can run every gameweek.

Below you’ll find a classroom-ready workflow (suitable for high school and early university), code templates, assessment ideas, and low-friction ways to run weekly updates using free tools in 2026’s teaching ecosystem.

Why FPL data is perfect for project-based learning in 2026

  • High student interest: Many students already follow the Premier League and enjoy fantasy sports. That intrinsic motivation increases engagement and persistence.
  • Rich, live data: FPL exposes free endpoints and public stats — ideal for repeated weekly experiments and learning the full data pipeline (fetch → clean → visualize → model → deploy).
  • Clear quantitative outcomes: Points, minutes, ownership, price changes and fixture difficulty give measurable targets for prediction and evaluation.
  • Cross-curricular potential: Combines statistics, coding (Python/JavaScript), and communication skills — a genuine interdisciplinary project.
  • Real-world data literacy: Students learn about noise, injuries, lineup uncertainty, and how to combine qualitative news (team updates) with quantitative features.

The 8-week classroom plan (fast, flexible, repeatable)

Use this as a template and adapt pacing to your term. The design blends statistics learning objectives with practical coding and project management.

  1. Week 0 (Setup): Introduce FPL concepts, install tools (Python + Jupyter/Colab, or Observable for JS), and fork the starter repo.
  2. Week 1 (Data): Fetch FPL data, inspect structure, and clean key fields (player id, team, position, total_points, minutes, value, ownership).
  3. Week 2 (Exploration & Visualizations): Build exploratory plots — distribution of points, top scorers, form trends, ownership vs points.
  4. Week 3 (Feature Engineering): Create features: rolling average form, fixture difficulty, minutes per 90, xG/xA (if available), injury flags from news feeds.
  5. Week 4 (Baseline Models): Fit simple models: mean predictor, linear regression, and explain residuals.
  6. Week 5 (Advanced Model & Interpretability): Train a gradient boosting model (e.g., XGBoost/LightGBM) and use SHAP or permutation importance to explain predictions.
  7. Week 6 (Dashboard & Weekly Tracker): Deploy a simple Streamlit/Voila/Observable dashboard that can be updated weekly via a script or GitHub Actions.
  8. Week 7–8 (Presentation & Iteration): Students present insights, evaluate model performance, and run a small tournament of prediction accuracy. Iterate based on feedback.

Fast wins for the first lesson (30–60 minutes)

  • Show a finished dashboard to spark curiosity.
  • Walk students through one API call and a plot of top-10 scorers.
  • Assign groups and roles: data engineer, analyst, modeler, presenter.

Data sources and ethical notes (2026 context)

The core public source used in community projects remains the FPL endpoints (bootstrap-static and per-player histories). In 2026, educators should keep two trends in mind:

  • Complementary open stats: Sites like FBref continue to publish advanced metrics (xG, xA) that are useful for feature enrichment; always check and respect the site's terms and attribution requirements.
  • Data minimization & copyright awareness: Use aggregated public numbers rather than republishing scraped proprietary content. When including team news or images, follow school policy and copyright rules.

“Before the latest round of Premier League fixtures, here is all the key injury news alongside essential Fantasy Premier League statistics.” — BBC Sport, 16 Jan 2026

Team news and injury reports are pedagogically valuable: they teach students how to combine qualitative signals (press conference updates) with quantitative features.

Starter tech stack (classroom-friendly)

  • Python: pandas, requests, plotly or Altair, scikit-learn, xgboost/lightgbm, SHAP, Streamlit. Works locally, in Colab, or on school VMs.
  • JavaScript: Observable notebooks with D3 or Plotly.js — great for front-end visualization classes.
  • No-code: Google Sheets + Data Studio for beginners; graduate students to Python for modeling.
  • Automation: GitHub Classroom for assignments; GitHub Actions or simple cron jobs for weekly updates; Streamlit Cloud or GitHub Pages for lightweight deployment.
  • AI-assisted coding (2025–26 trend): Tools like GitHub Copilot and other code assistants speed up scaffolding — use them to teach prompt engineering and responsible AI use.

Step-by-step: fetch, clean, and explore FPL data (practical)

1. Fetch the core FPL dataset

A commonly used endpoint returns player and team info in JSON. In Python the minimal call looks like this:

import requests

url = 'https://fantasy.premierleague.com/api/bootstrap-static/'
resp = requests.get(url)
data = resp.json()
# save for reproducibility
import json
with open('bootstrap-static.json','w') as f:
    json.dump(data, f)

Key objects: elements (players), teams, events (gameweeks). Save snapshots each week so students can practice reproducible analysis.

2. Clean and normalize

  • Normalize player names and positions.
  • Convert price to numeric (FPL historically uses integer units).
  • Build a gameweek timeline — cumulative points per player, rolling 3- and 5-gameweek averages.

3. Add contextual features

  • Fixture difficulty: encode upcoming opponents (simple approach: opponent rank; advanced: expected goals conceded).
  • Minutes bias: minutes per 90 or percent of team minutes — vital for benchwarmers.
  • Market signals: ownership and price changes as a proxy for popularity and manager expectations.
  • News flags: parse weekly team news and set binary flags for injury/return/doubt.

Visualizations that teach core statistics concepts

Use visual tasks to teach distribution, correlation, time series, and sampling:

  • Histogram + boxplot: points per game — discuss skew, outliers, and central tendency.
  • Time series: rolling averages show smoothing and the tension between signal and noise.
  • Scatter plot: ownership vs points to discuss correlation, confounding, and Simpson’s paradox in group comparisons.
  • Heatmaps: map positions to expected attacking involvement or clean sheets.

Example classroom exercise: “Choose two forwards and compare whether their last 5-gameweek form predicts next-week points better than season-long averages. Use confidence intervals.”

Predictive modeling: teach science through iteration

Modeling is a lesson in experimentation. Start simple, measure clearly, iterate.

Baseline models

  • Naïve mean predictor: predict next-gamepoints as player’s mean points to date.
  • Rolling mean: last 3 gameweeks — demonstrates recency effects.
  • Linear regression: features: rolling form, minutes, fixture difficulty. Discuss assumptions and residual plots.

Advanced model & evaluation

Train a gradient boosting model (XGBoost/LightGBM). Use time-aware cross-validation (TimeSeriesSplit) and metrics like MAE/RMSE. Teach students why standard random splits can leak future information.

from sklearn.model_selection import TimeSeriesSplit
from sklearn.metrics import mean_absolute_error
import xgboost as xgb

# X, y prepared with time ordering
cv = TimeSeriesSplit(n_splits=5)
for train_idx, val_idx in cv.split(X):
    model = xgb.XGBRegressor(n_estimators=100)
    model.fit(X[train_idx], y[train_idx])
    preds = model.predict(X[val_idx])
    print('MAE:', mean_absolute_error(y[val_idx], preds))

Interpretability

Teach SHAP or permutation importance so students can explain predictions: which features pushed a player above their expected points? This fosters critical thinking about model trust.

Weekly tracker: make updating painless

The project’s real value comes from iteration. Here’s a minimal weekly workflow students can run in under 10 minutes after each gameweek.

  1. Run a single Python script (or a GitHub Action) that pulls the latest FPL snapshot and player histories.
  2. Recompute rolling features and either re-fit models or update predictions using incremental learning.
  3. Save updated plots and a “Top 5 picks” CSV for the coming gameweek.
  4. Publish the dashboard update (Streamlit Cloud, GitHub Pages, or a public Google Drive folder) and submit one-slide reflections.

Automation options (2026-friendly):

  • GitHub Actions: schedule weekly runs to fetch data and push updated artifacts.
  • Streamlit Cloud / Hugging Face Spaces: host a simple app that reads CSVs from the repo and refreshes on commit.
  • Colab + Drive: for short-term runs, students can execute a notebook and export results to Drive.

Assessment & metrics — keep grading transparent

Use a rubric that rewards reproducibility and critical thinking, not just model accuracy.

  • Pipeline (20%): reproducible fetch/clean scripts and documented sources.
  • EDA (20%): insightful visualizations with correct interpretations.
  • Modeling (25%): baseline + one advanced model, cross-validation, and error analysis.
  • Explainability (20%): feature importance and limitations discussion.
  • Presentation (15%): clear dashboard and a concise class report.

Classroom variations & extension projects

Statistics-focused

  • Hypothesis tests: Do higher-owned players score more points, controlling for minutes? Teach t-tests and regression diagnostics.
  • Bayesian modeling: estimate posterior distributions for player ability and compare credible intervals.

Computer science / data engineering

  • Build a small ETL pipeline with Airflow or Prefect Core (or a simplified Task Runner) to automate weekly refreshes.
  • Introduce APIs, rate limits, and basic caching strategies to avoid hitting endpoints repeatedly.

Communications & argumentation

  • Students prepare a short “captain’s brief” each week: three recommended transfers, one risk, and a one-sentence justification with model confidence.
  • Hold a class debate on model vs human intuition using recent match outcomes and team news (ties to BBC-style reporting).

Practical templates & teacher-ready snippets

Below are compact, reusable templates you can drop into notebooks or assignments.

1) Simple fetch & save (Python)

import requests, json
url = 'https://fantasy.premierleague.com/api/bootstrap-static/'
resp = requests.get(url)
with open('data/bootstrap-static.json','w') as f:
    json.dump(resp.json(), f)

2) Rolling form feature (pandas)

import pandas as pd
# assume gw_history is a dataframe with columns: player_id, gw, points
gw_history['rolling3'] = gw_history.groupby('player_id')['points'].transform(lambda s: s.rolling(3, min_periods=1).mean())

3) Quick Streamlit layout (dashboard)

import streamlit as st
import pandas as pd

st.title('FPL Weekly Tracker')
df = pd.read_csv('data/players_latest.csv')
st.dataframe(df.sort_values('predicted_points', ascending=False).head(10))

Late 2025 and early 2026 saw a few developments that make this project more accessible and relevant:

  • AI-assisted notebooks: Code assistants like Copilot and integrated AI suggestions in notebooks speed setup and help students iterate. Use them to teach responsible AI use and prompt refinement.
  • Low-cost hosting: Streamlit Cloud and Hugging Face Spaces have expanded free tiers for educators, making weekly sharing simpler than ever.
  • Data literacy frameworks: Schools increasingly adopt data ethics and reproducibility as core outcomes; this project maps directly to those frameworks by requiring reproducible fetches and transparent model explanations.

Common pitfalls and how to avoid them

  • Overfitting to recent hauls: teach time-aware validation and penalize overly complex models in grading.
  • Ignoring minutes: always include minutes or a binary starter flag — big point hauls from low-minute substitutes are outliers, not trends.
  • Automation mistakes: schedule data pulls after official gameweek updates to avoid partial data snapshots.
  • Attribution & scraping: don’t republish copyrighted commentary; summarize and link where appropriate.

Example classroom mini-case (hypothetical)

A Year 12 class ran this project across eight lessons. They used the rolling 3-gameweek mean baseline initially and improved MAE by 12% using LightGBM with fixture difficulty and minutes-per-90. The class learned to trust model explanations: SHAP plots showed ownership and difficulty were primary drivers for their top-sleeper predictions. Most importantly, students enjoyed the weekly rhythm: a 10-minute refresh each week that led to real debate and iterative improvement.

Next steps & call to action

Ready to bring this to your classroom? Start with a single lesson that fetches data and draws one plot. Use the 8-week plan as your map and pick one automation path (Colab or GitHub Actions) for weekly updates.

Try this now: copy the starter fetch snippet into a Colab notebook, run it, and make a bar chart of top 10 scorers. Then assign students roles and run week 1 next lesson.

If you want a starter repo, assessment rubric, and a teacher cheat-sheet (one page) to deploy the weekly tracker in 30 minutes, sign up for the free classroom pack linked on our teacher resources page or adapt the snippets above into GitHub Classroom.

Make it iterative, measurable, and fun — and your students will learn statistics and coding by doing, not by memorizing.

Advertisement

Related Topics

#data literacy#project-based learning#sports analytics
U

Unknown

Contributor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.

Advertisement
2026-02-28T01:25:33.668Z