Skip to content
← cd ../work
machine learninglive

Football Match Predictor

A machine learning model that gives win, draw and loss probabilities for matches in seven European leagues, tested honestly on matches it never saw, and retrained every week.

note: the demo runs on free hosting, so the first load can take up to a minute while the server wakes up.

Football Match Predictor showing Bournemouth vs Arsenal with 24% home win, 23% draw and 53% away win probabilities

Results

Results called correctly on 1,043 unseen matches
50.7%
Better than always picking the home team (42.8%)
+8 pts
Log loss, against 1.076 for the baseline (lower is better)
0.999
European leagues covered
7
Matches in the dataset
5,215

cat problem.md

The problem

Football predictions online usually come with a confident pick and an impressive accuracy figure that nobody can check. A useful model has to be tested on matches it has never seen, compared against simple baselines, and honest about how hard the problem is. Bookmakers themselves typically get the result right only 50 to 53% of the time.

What we built

A model that predicts Home Win, Draw or Away Win for the Premier League, La Liga, Serie A, Bundesliga, Eredivisie, Ligue 1 and Primeira Liga, shown as probabilities rather than a single pick. A web app lets anyone choose a league and two teams, and a public API returns the same prediction with the numbers behind it.

Each team is described by 14 numbers (7 per team): an Elo strength rating, points and goals per game this season, home or away form, and form over the last five matches. Every number is taken from the team’s state before kick-off, so the model never sees the result it is predicting.

The 71% we withdrew

An earlier version of this project reported 71% accuracy. That figure was wrong: some features included the result of the match being predicted, a bug called data leakage. We found it, rebuilt the features so they are computed match by match in date order, and withdrew the number. The honest figure is 50.7%, in line with what bookmakers achieve.

A model that looks great in testing and fails on real data is worse than no model. Checking for leakage is the first thing we do on any prediction project.

Why the simplest model won

We tested three models on the 1,043 most recent matches (16 March to 19 October 2026), which none of them saw during training or tuning:

Model Accuracy Log loss
Always predict home win 42.8% -
Logistic regression (used live) 50.7% 0.999
Gradient boosting 50.7% 1.009
Neural network (PyTorch) 48.0% 1.015

The simple model matched or beat the complex ones, so it is the one that runs. It is also small enough to serve from a JSON file with no machine learning libraries installed, which keeps hosting free.

Keeps itself up to date

A scheduled GitHub Actions job pulls the latest results every Tuesday, rebuilds the dataset and retrains the model. The new model goes live after a manual check, so a bad data pull never reaches visitors.

What this means for your business

The same method applies to any “what happens next” question with a history behind it: which leads will buy, which customers are about to leave, how much stock to order. Start with a simple baseline, test on data the model has never seen, and only add complexity when it measurably helps.

cat project.json

industry:
Sports analytics
built:
October 2026
stack:
Pythonpandasscikit-learnPyTorchWeights & BiasesMySQLFastAPIStreamlitGitHub ActionsRender

cat next-step.md

Want results like these?

Book a free 30-minute strategy call. You'll leave with at least one concrete idea, whether or not we work together.

Book a Free Strategy Call