With FIFA set to kick off on Thursday, June 11, 2026, the opening match on the Mexico Metropolis Stadium, I feel it will be enjoyable to construct one of the best ML mannequin we will to foretell match outcomes. To do that, I’ve introduced collectively a number of databases—49,000 matches—with knowledge on Elo scores, match outcomes, and cup places. From FIFA to the Baltic Cup, with matches from 1872 to 2026, we are going to take a probabilistic method to the game.
We’ll examine the efficiency of a number of ML fashions, together with
- multinomial regression
- multinomial ridge / elastic-net mannequin
- LightGBM
We may also work to know the strengths and weaknesses of our fashions to create a well-calibrated mannequin that predicts house wins 86% of the time. By weighing mannequin efficiency, calibration, and complexity, we are going to discover one of the best mannequin for our knowledge.
Soccer by the Numbers

Lots of people say soccer is sleep-inducing. As a soccer fan, I disagree, however to be honest, this isn’t with out motive. Nearly all of matches finish with fewer than 5 targets, and something above 20 is an anomaly, if not unattainable. In distinction, it’s not unusual for one participant to attain greater than 50 factors in an NBA sport. However regardless of the tempo, pubs from England to botecos in Rio stay full.
What critics don’t perceive is that the low rating could make a sport extra attention-grabbing, as this makes it tougher for groups to realize a considerable lead, maintaining followers on the sting till the top. Sadly, this additionally means matches finish in a draw near 22% of the time—which will also be infuriating. But the game stays as widespread as ever.

The truth that so many matches finish in a draw really turns into a modeling drawback later, however earlier than we get to that lets go over how we put this knowledge togther.
Stitching the information collectively
Oftentimes one of the simplest ways to enhance a mannequin is to easily get extra knowledge. We shall be working with international_results.csv, international_team_ratings.csv and international_goalscorers.csv
We wish to matchinternational_results.csv to international_team_ratings.csv so we will use Elo scores. This may very well be easy, however as you would possibly’ve guessed, the workforce names don’t match up completely, so we have to flip to textual content processing until we wish to examine 336 groups individually. We additionally should be extremely cautious of when the Elo score was up to date. We might take the Elo on the identical day the match happens, however that might be a supply of information leakage, as Elo scores are up to date solely after the match. Making use of it as a function tempting however problematic.
We should take the newest Elo rating, and as a further engineered function we preserve observe of the time for the reason that newest Elo replace, positing that earlier scores can be extra informative than older ones. The code for becoming a member of these tables and all the undertaking is on the market within the Appendix.

international_results.csv
| Area sort | Examples |
|---|---|
| Match identification | source_match_id, date, season, competitors |
| Groups | home_team, away_team |
| Closing end result | home_score, away_score, match_result, result_class |
| Context | impartial, event, metropolis, nation |
international_team_ratings.csv
| Function | That means |
|---|---|
home_rating_pre_match |
House workforce Elo earlier than kickoff |
away_rating_pre_match |
Away workforce Elo earlier than kickoff |
rating_diff |
House Elo minus away Elo |
rating_age_days_home |
How stale the house workforce score is |
rating_age_days_away |
How stale the away workforce score is |
international_goalscorers.csv
| Function concept | That means |
|---|---|
| Distinctive scorers in current matches | Whether or not a workforce relies on one scorer or many |
| Targets by high scorer | Focus of scoring |
| Current scoring kind | Attacking output earlier than this match |

As a result of we’re doing a time-series prediction, we have to guarantee our break up respects the time order. We’ll consider our mannequin on all video games from 2018 onward, which might be roughly 8,000 matches.
| Efficient break up | Approximate date logic |
|---|---|
| mannequin practice | earlier a part of pre-2018 knowledge |
| validation | newest ~20% of the pre-2018 coaching pool |
| take a look at | 2018 onward |
Engineered Options

We wish to transfer from primary match-level predictors in the direction of richer pre-match options that seize: workforce power, attacking and defensive high quality, house/away results, matchup stability, goalkeeper power, historic efficiency tendencies.
1. Draw-modeling options
Probably the most evident failure of our baseline multinomial logistic regression mannequin was its weak efficiency at classifying attracts. Whereas the mannequin might calculate the likelihood of a draw as a result of we outlined the goal variable as match_result ∈ {H, D, A} (House win, Draw, Away win), Draw was merely by no means the most certainly end result. We will see this by the lacking column for Attracts within the confusion matrix.

This poor draw efficiency isn’t particular to 1 mannequin household. After we isolate high-confidence errors — circumstances the place the mannequin’s predicted class was improper, and its most predicted likelihood was not less than 0.60 — the identical sample seems throughout fashions: they’re systematically overconfident in house wins. Many matches that really led to attracts have been assigned a assured home-win prediction, suggesting that the fashions seize team-strength path higher than match-level uncertainty or draw chance.

To deal with this ‘blindness’ to the draw choice, we will engineer options similar to abs_rating_diff, home_draw_rate_last_5, form_draw_rate_mean_last_5, and binary context options like impartial, flag_is_world_cup, and flag_is_friendly, indicating whether or not the match is on impartial floor or on the World Cup.
| Function group | That means | Examples |
|---|---|---|
| Elo closeness | Measures how evenly matched the groups are. Smaller score gaps are particularly related for draw likelihood. | abs_rating_diff |
| Current draw tendency | Measures how usually every workforce’s prior matches led to attracts. | home_draw_rate_last_5, away_draw_rate_last_10 |
| Mixed draw tendency | Captures whether or not each groups have just lately been draw-prone. | form_draw_rate_mean_last_5, form_draw_rate_mean_last_10 |
| Match context | Match and venue indicators that will have an effect on draw frequency. | impartial, flag_is_world_cup, flag_is_friendly |

With these options, our mannequin can now higher discriminate between House/Away wins and attracts, as evidenced by a 3.3% improve in true-positive draw predictions. That is nonetheless low, on condition that ~20% of matches finish in attracts. So our options assist however not by a lot. This means that it may very well be price constructing a mannequin devoted to attract modeling, with the goal variable match_result ∈ {D, ¬D}, however for now we have to engineer extra options.
¬D represents not D which means our goal variable is the match ends in draw (1), or match doesn’t finish in draw (0)

2. Elo options
The common workforce has an Elo barely above 1500; that is close to Saudi Arabia, Iceland, and Haiti for FIFA 2026. After we graph the distributions of House wins, Attracts, and away wins, we will see that because the distinction decreases, Attracts grow to be more and more possible. Our distributions are additionally barely shifted to the left, indicating a small house benefit, as anticipated.


We might be leaving LogLoss factors on the desk if we relied solely on pre-match Elo as our solely function. To get essentially the most from the information, we additionally
| Function | That means |
|---|---|
home_rating_pre_match |
House workforce Elo score earlier than kickoff. |
away_rating_pre_match |
Away workforce Elo score earlier than kickoff. |
rating_diff |
House workforce Elo minus away workforce Elo earlier than kickoff. Constructive values favor the house workforce. |
rating_age_days_home |
Days for the reason that house workforce’s Elo score was final up to date. |
rating_age_days_away |
Days for the reason that away workforce’s Elo score was final up to date. |

3. Rolling past-performance options
A critic might argue that utilizing rolling previous efficiency and Elo isn’t a good suggestion, since they each mannequin workforce power, which might add redundant or extremely correlated options to the mannequin.
Rolling previous efficiency does seize workforce power, however it’s particularly there to assist the modeling of workforce momentum. Profitable streaks are a really actual factor in sports activities. The truth is, the present best choice by supercomputers is Spain. One motive they’re predicted first is their historic 31-match unbeaten streak coming into FIFA 2026.
| Function group | That means | Examples |
|---|---|---|
| Current factors per match | Common factors earned over every workforce’s earlier 5 or 10 matches. | home_points_per_match_last_5, away_points_per_match_last_10 |
| Current aim distinction | Common targets scored minus targets conceded over prior matches. | home_goal_diff_per_match_last_5, away_goal_diff_per_match_last_10 |
| Current draw fee | Share of prior matches that led to a draw. | home_draw_rate_last_5, away_draw_rate_last_10 |
| House-away kind variations | Distinction between the house and away groups on the identical rolling metric. | form_points_diff_last_5, form_goal_diff_diff_last_10 |
| Prior match counts | Variety of earlier matches out there earlier than the fixture. | home_prior_matches, away_prior_matches |
4. Assault and protection kind options
Whereas our mannequin tried to seize attacking and defending workforce power by way of factors, that is the place our mannequin falls in need of super-computer approaches. Fashionable approaches usually additionally implement participant knowledge, which is invaluable in computing a workforce’s strengths. As a result of we’re working solely with game-level knowledge, our modeling of attacking and defensive options is computed from earlier match outcomes like Current scoring charges, conceding charges, Scoring-rate distinction, and Conceding-rate distinction.
| Function group | That means | Examples |
|---|---|---|
| Current scoring fee | Common targets scored per match over the earlier 5 or 10 matches. | home_goals_for_per_match_last_5, away_goals_for_per_match_last_10 |
| Current conceding fee | Common targets conceded per match over the earlier 5 or 10 matches. | home_goals_against_per_match_last_5, away_goals_against_per_match_last_10 |
| Scoring-rate distinction | House workforce’s current scoring fee minus away workforce’s current scoring fee. | form_goals_for_diff_last_5, form_goals_for_diff_last_10 |
| Conceding-rate distinction | House workforce’s current conceding fee minus away workforce’s current conceding fee. Decrease values favor the house workforce defensively. | form_goals_against_diff_last_5, form_goals_against_diff_last_10 |

Grid Search
As a result of massive search grids can overfit in cross-validation, and grid search scales multiplicatively, parameters are searched logarithmically (1e-5, 1e-4, 1e-3, 1e-2). Besides with parameters like alpha, which should exist between zero and one.
glmnet_alphaControls the elastic-net mix between ridge and lasso regression, the place zero is Pure ridge, and one is pure lasso.
multinomial_decaypenalizes massive coefficients extra. That may cut back overfitting, however extreme decay can result in underfitting.
Grid Search O(n) = quantity of configurations examined × time to practice one mannequin
| Mannequin household | Grid/configurations proven | What was tuned |
|---|---|---|
| Baselines | majority_baseline, frequency_baseline, rating_diff_multinom |
Principally not tuned; comparability baselines |
| glmnet | alpha = 0, .25, .5, .75, 1 |
Elastic-net mixing parameter |
| multinom | decay = 0, 1e-5, 1e-4, 1e-3, 1e-2 |
L2 weight decay / coefficient shrinkage |
| LightGBM | less_regular, deeper, more_regular, current_final, l2_regularized, shallower, l1_l2_regularized, compact_robust, faster_small, slower_small |
Named bundles of tree-depth, learning-rate, boosting-round, and regularization settings |
LightGBM was essentially the most advanced mannequin household within the comparability. Not like the baseline fashions, which used few or no tuning parameters, LightGBM required selections about tree complexity, studying fee, boosting rounds, and regularization. This made it extra versatile, but in addition elevated the danger of overfitting if the parameters weren’t tuned fastidiously. We additionally must take care to not use a mannequin that’s extra difficult than our knowledge requires, as we might lose out on interpretability.
The GBM parameters have been tuned by evaluating a compact grid of LightGBM configurations. These configurations various tree complexity, studying pace, variety of boosting rounds, and regularization power, maintaining one of the best mannequin scored on log-loss. Under is a listing of the LightGBM parameters.
| Parameter | That means |
|---|---|
learning_rate |
How a lot every new tree is allowed to alter the mannequin. Decrease values be taught extra slowly however can generalize higher. |
num_iterations / nrounds |
Variety of boosting rounds, which means what number of bushes are added. Extra bushes can enhance efficiency however can even overfit. |
num_leaves |
Controls how advanced every tree might be. Extra leaves enable extra detailed patterns however improve overfitting danger. |
max_depth |
Most depth of every tree. Deeper bushes seize extra advanced interactions. Shallower bushes are less complicated and safer. |
min_data_in_leaf |
Minimal variety of observations required in a leaf. Greater values make the mannequin much less delicate to small noisy patterns. |
lambda_l1 |
L1 regularization. Pushes some results towards zero, making the mannequin less complicated. |
lambda_l2 |
L2 regularization. Shrinks massive results and reduces overconfidence. |
feature_fraction |
Fraction of options used for every tree. Utilizing fewer options can cut back overfitting. |
bagging_fraction |
Fraction of rows used for every tree. Utilizing fewer rows can even cut back overfitting. |
bagging_freq |
How usually row subsampling is utilized. If set to 0, bagging is often off. |


Closing Mannequin
The official chosen mannequin was LightGBM with the safe_plus_form_compact function set, utilizing 20 pre-match options drawn from Elo scores, event context, and lagged workforce summaries. It was chosen primarily based on the bottom validation-set multiclass log loss, with the take a look at set reserved for last reporting.
The chosen LightGBM mannequin achieved a validation log lack of 0.893 and a take a look at log loss of 0.873. Its validation end result was one of the best throughout the Mannequin comparability, however the margin over regression was small: multinomial regression trailed by solely about 0.002 log-loss factors on validation. On the held-out take a look at set, multinomial regression barely outperformed LightGBM on each log loss and macro F1.

Which means the end result ought to be interpreted cautiously. LightGBM is the formally chosen predictive mannequin, however the proof doesn’t present that gradient boosting clearly dominates less complicated regression fashions for the given knowledge. Regression fashions stay extremely essential as a result of they’re simpler to interpret and carry out almost in addition to, and in some take a look at metrics barely higher than, different strategies.

Function engineering produced equally modest beneficial properties. Compact lagged options improved validation log loss relative to baseline, however the take a look at enchancment was tiny. Goalscorer options didn’t meaningfully enhance log loss within the Mannequin comparability.

The clearest limitation was draw prediction. The chosen mannequin nearly by no means predicted draw as the highest class: on the take a look at set, it accurately predicted solely 2 attracts out of 1,784 precise attracts, for draw recall of 0.11%. This means that the mannequin’s likelihood estimates should still include helpful info, however argmax classification stays strongly biased towards house and away wins, making a separate mannequin for draw modeling an affordable subsequent step. Elo and compact pre-match kind present a helpful sign stack, however the beneficial properties over robust baselines are incremental.
The mannequin is a lot better at predicting house wins than away wins on the take a look at set:
- It accurately identifies about 87% of precise house wins
- It accurately identifies about 63% of precise away wins
The mannequin can also be able to outputting a likelihood distribution over House, Draw, and Away wins, which is commonly extra helpful than only a single arduous prediction.
Calibration

The baseline-plus fashions are broadly nicely calibrated on the take a look at set. Throughout confidence bins. This implies predicted confidence tracks noticed accuracy, which means when the fashions are reasonably assured, they’re appropriate at roughly the corresponding fee, and when confidence rises, noticed accuracy rises with it. The deviations from the best calibration line are modest, suggesting that the fashions’ likelihood estimates are usually usable quite than only a rank-ordering of outcomes.
The plot under measures calibration of the highest predicted class—the mannequin’s confidence in whichever end result it selected—not calibration for house wins, attracts, and away wins individually. A mannequin can due to this fact look nicely calibrated general whereas nonetheless misestimating one class, particularly attracts. The combination calibration plot helps the declare that the fashions’ confidence scores are broadly reliable, however it doesn’t, by itself, present that the draw possibilities are nicely calibrated.

The category-specific calibration plots present the place that combination image holds and the place it turns into extra difficult. House-win and away-win possibilities comply with the best calibration line intently throughout most bins: because the mannequin assigns greater likelihood to both end result, the noticed frequency rises at roughly the identical fee. In sensible phrases, the mannequin’s house and away possibilities behave like significant possibilities, not simply scores.

Attracts are totally different. The mannequin’s draw possibilities are moderately calibrated inside its vary, however that vary is slim. It not often assigns draw possibilities a lot above the low-to-middle vary, even when the match is comparatively balanced.
That is the central distinction: the mannequin doesn’t ignore attracts; it often treats them as danger elements quite than possible outcomes. Draw possibilities should still be helpful for measuring draw danger, however attracts seldom grow to be the mannequin’s high prediction, which helps clarify the persistent weak point in draw recall.

Ranking Distinction Evaluation
The rating-difference evaluation exhibits why attracts are structurally troublesome for the mannequin. Noticed draw charges are highest when the groups are intently matched and decline as absolutely the Elo score hole widens. All three mannequin households be taught this broad sample: their predicted draw possibilities additionally fall as matches grow to be extra lopsided.
The failure isn’t directional however scalar. In essentially the most evenly matched fixtures, the noticed draw fee is roughly one-third, whereas the fashions assign draw possibilities nearer to one-quarter. They accurately establish balanced matches as extra draw-prone, however they don’t increase the draw likelihood sufficient. Because of this, the mannequin can acknowledge draw danger with out usually deciding on a draw because the most certainly end result. This reconciles the obvious contradiction between affordable draw calibration and weak draw recall: the possibilities transfer in the precise path, however often not far sufficient to win the argmax resolution, that being to select the category with the best predicted likelihood.

Function Significance
As you would possibly anticipate, an important function for our mannequin is the score distinction, adopted by whether or not the match was on neural floor—a distant second. By checking the function significance, we will see which of our engineered options supplied significant sign.


Conclusion
I feel this can be a good time to debate dataset measurement and mannequin alternative. Sometimes, the bigger and extra advanced the dataset, the extra motive we’ve got to decide on a extra difficult mannequin. As we noticed on this instance, the beneficial properties from switching from regression to LightGBM have been very small; this can be a good signal that making an attempt a extra advanced mannequin on this knowledge is not going to yield higher predictions. Soccer forecasting is much less about discovering a magic algorithm and extra about constructing leakage-safe options, evaluating interpretable baselines, and asking whether or not the mannequin’s confidence is deserved.
For now, one factor is evident: wer’re gonna want extra knowledge if we wish to get a greater prediction. Significantly player-level knowledge—realizing if Neymar is sitting out is essential. The granularity of the information can also be essential if we wish to change our forecast as the sport progresses.
Apendix
The code for the entire undertaking might be discovered on my GitHub
The information supply has a Artistic Commons CC0-1.0 license
make_team_clean <- operate(team_name) > stringr::str_replace_all("^
- stringr::str_squish()
- stringi::stri_trans_general(“Latin-ASCII”)
- Converts accented Latin characters to plain ASCII characters.
- str_to_lower()
- stringr::str_replace_all(“[^a-z0-9]+”, “_”)
- It replaces something that isn’t a lowercase letter or quantity with an underscore.
















