With FIFA set to kick off on Thursday, June 11, 2026, the opening match on the Mexico Metropolis Stadium, I believe it will be enjoyable to construct the most effective ML mannequin we will to foretell match outcomes. To do that, I’ve introduced collectively a number of databases—49,000 matches—with information 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 are going to examine the efficiency of a number of ML fashions, together with
- multinomial regression
- multinomial ridge / elastic-net mannequin
- LightGBM
We will even work to grasp 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 the most effective mannequin for our information.
Soccer by the Numbers
Lots of people say soccer is sleep-inducing. As a soccer fan, I disagree, however to be truthful, this isn’t with out cause. Nearly all of matches finish with fewer than 5 targets, and something above 20 is an anomaly, if not inconceivable. In distinction, it’s not unusual for one participant to attain greater than 50 factors in an NBA recreation. 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 recreation extra attention-grabbing, as this makes it more durable for groups to achieve a considerable lead, retaining followers on the sting till the tip. Sadly, this additionally means matches finish in a draw near 22% of the time—which can 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 information togther.
Stitching the info collectively
Oftentimes one of the best ways to enhance a mannequin is to easily get extra information. We will probably be working with international_results.csv, international_team_ratings.csv and international_goalscorers.csv
We need 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 staff names don’t match up completely, so we have to flip to textual content processing except we need to test 336 groups individually. We additionally must be extremely cautious of when the Elo ranking was up to date. We might take the Elo on the identical day the match happens, however that might be a supply of knowledge 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 monitor of the time for the reason that newest Elo replace, positing that earlier scores could be extra informative than older ones. The code for becoming a member of these tables and all the undertaking is accessible within the Appendix.

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

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

We need to transfer from fundamental match-level predictors in the direction of richer pre-match options that seize: staff power, attacking and defensive high quality, house/away results, matchup steadiness, goalkeeper power, historic efficiency tendencies.
1. Draw-modeling options
Essentially 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 probably final result. We are able to see this by the lacking column for Attracts within the confusion matrix.

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

To deal with this ‘blindness’ to the draw choice, we will engineer options resembling 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.
| Characteristic group | That means | Examples |
|---|---|---|
| Elo closeness | Measures how evenly matched the groups are. Smaller ranking gaps are particularly related for draw likelihood. | abs_rating_diff |
| Latest draw tendency | Measures how usually every staff’s prior matches resulted in attracts. | home_draw_rate_last_5, away_draw_rate_last_10 |
| Mixed draw tendency | Captures whether or not each groups have not too long ago 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% enhance 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 implies that it may very well be value 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 typical staff has an Elo barely above 1500; that is close to Saudi Arabia, Iceland, and Haiti for FIFA 2026. Once we graph the distributions of House wins, Attracts, and away wins, we will see that because the distinction decreases, Attracts develop into more and more probably. 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 info, we additionally
| Characteristic | That means |
|---|---|
home_rating_pre_match |
House staff Elo ranking earlier than kickoff. |
away_rating_pre_match |
Away staff Elo ranking earlier than kickoff. |
rating_diff |
House staff Elo minus away staff Elo earlier than kickoff. Optimistic values favor the house staff. |
rating_age_days_home |
Days for the reason that house staff’s Elo ranking was final up to date. |
rating_age_days_away |
Days for the reason that away staff’s Elo ranking was final up to date. |

3. Rolling past-performance options
A critic might argue that utilizing rolling previous efficiency and Elo just isn’t a good suggestion, since they each mannequin staff power, which might add redundant or extremely correlated options to the mannequin.
Rolling previous efficiency does seize staff power, however it’s particularly there to assist the modeling of staff momentum. Profitable streaks are a really actual factor in sports activities. Actually, the present best choice by supercomputers is Spain. One cause they’re predicted first is their historic 31-match unbeaten streak coming into FIFA 2026.
| Characteristic group | That means | Examples |
|---|---|---|
| Latest factors per match | Common factors earned over every staff’s earlier 5 or 10 matches. | home_points_per_match_last_5, away_points_per_match_last_10 |
| Latest objective distinction | Common targets scored minus targets conceded over prior matches. | home_goal_diff_per_match_last_5, away_goal_diff_per_match_last_10 |
| Latest draw fee | Share of prior matches that resulted in a draw. | home_draw_rate_last_5, away_draw_rate_last_10 |
| House-away type 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 type options
Whereas our mannequin tried to seize attacking and defending staff power via factors, that is the place our mannequin falls in need of super-computer approaches. Fashionable approaches usually additionally implement participant information, which is invaluable in computing a staff’s strengths. As a result of we’re working solely with game-level information, our modeling of attacking and defensive options is computed from earlier match outcomes like Latest scoring charges, conceding charges, Scoring-rate distinction, and Conceding-rate distinction.
| Characteristic group | That means | Examples |
|---|---|---|
| Latest 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 |
| Latest 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 staff’s current scoring fee minus away staff’s current scoring fee. | form_goals_for_diff_last_5, form_goals_for_diff_last_10 |
| Conceding-rate distinction | House staff’s current conceding fee minus away staff’s current conceding fee. Decrease values favor the house staff defensively. | form_goals_against_diff_last_5, form_goals_against_diff_last_10 |

Grid Search
As a result of giant 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 giant coefficients extra. That may scale 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 complicated 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 chance of overfitting if the parameters weren’t tuned rigorously. We additionally have to take care to not use a mannequin that’s extra sophisticated than our information requires, as we might lose out on interpretability.
The GBM parameters have been tuned by evaluating a compact grid of LightGBM configurations. These configurations different tree complexity, studying pace, variety of boosting rounds, and regularization power, retaining the most effective mannequin scored on log-loss. Beneath is a listing of the LightGBM parameters.
| Parameter | That means |
|---|---|
learning_rate |
How a lot every new tree is allowed to vary the mannequin. Decrease values be taught extra slowly however can generalize higher. |
num_iterations / nrounds |
Variety of boosting rounds, which means what number of timber are added. Extra timber can enhance efficiency however also can overfit. |
num_leaves |
Controls how complicated every tree might be. Extra leaves enable extra detailed patterns however enhance overfitting threat. |
max_depth |
Most depth of every tree. Deeper timber seize extra complicated interactions. Shallower timber are easier and safer. |
min_data_in_leaf |
Minimal variety of observations required in a leaf. Larger values make the mannequin much less delicate to small noisy patterns. |
lambda_l1 |
L1 regularization. Pushes some results towards zero, making the mannequin easier. |
lambda_l2 |
L2 regularization. Shrinks giant results and reduces overconfidence. |
feature_fraction |
Fraction of options used for every tree. Utilizing fewer options can scale back overfitting. |
bagging_fraction |
Fraction of rows used for every tree. Utilizing fewer rows also can scale back overfitting. |
bagging_freq |
How usually row subsampling is utilized. If set to 0, bagging is often off. |


Last 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 staff summaries. It was chosen based mostly on the bottom validation-set multiclass log loss, with the check set reserved for closing reporting.
The chosen LightGBM mannequin achieved a validation log lack of 0.893 and a check log loss of 0.873. Its validation end result was the most effective 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 check set, multinomial regression barely outperformed LightGBM on each log loss and macro F1.

Which means the end result must be interpreted cautiously. LightGBM is the formally chosen predictive mannequin, however the proof doesn’t present that gradient boosting clearly dominates easier regression fashions for the given information. Regression fashions stay extremely vital as a result of they’re simpler to interpret and carry out practically in addition to, and in some check metrics barely higher than, different strategies.

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

The clearest limitation was draw prediction. The chosen mannequin virtually by no means predicted draw as the highest class: on the check set, it appropriately predicted solely 2 attracts out of 1,784 precise attracts, for draw recall of 0.11%. This implies that the mannequin’s likelihood estimates should include helpful info, however argmax classification stays strongly biased towards house and away wins, making a separate mannequin for draw modeling an inexpensive subsequent step. Elo and compact pre-match type present a helpful sign stack, however the beneficial properties over sturdy baselines are incremental.
The mannequin is a lot better at predicting house wins than away wins on the check set:
- It appropriately identifies about 87% of precise house wins
- It appropriately 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 usually extra helpful than only a single exhausting prediction.
Calibration

The baseline-plus fashions are broadly effectively calibrated on the check 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 typically usable relatively than only a rank-ordering of outcomes.
The plot beneath measures calibration of the highest predicted class—the mannequin’s confidence in whichever final result it selected—not calibration for house wins, attracts, and away wins individually. A mannequin can due to this fact look effectively calibrated total whereas nonetheless misestimating one class, particularly attracts. The mixture calibration plot helps the declare that the fashions’ confidence scores are broadly reliable, nevertheless it doesn’t, by itself, present that the draw possibilities are effectively calibrated.

The category-specific calibration plots present the place that mixture image holds and the place it turns into extra sophisticated. House-win and away-win possibilities comply with the best calibration line intently throughout most bins: because the mannequin assigns greater likelihood to both final 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 completely different. The mannequin’s draw possibilities are fairly calibrated inside its vary, however that vary is slender. 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 threat components relatively than probably outcomes. Draw possibilities should be helpful for measuring draw threat, however attracts seldom develop into the mannequin’s prime prediction, which helps clarify the persistent weak point in draw recall.

Ranking Distinction Evaluation
The rating-difference evaluation reveals why attracts are structurally tough for the mannequin. Noticed draw charges are highest when the groups are intently matched and decline as absolutely the Elo ranking hole widens. All three mannequin households be taught this broad sample: their predicted draw possibilities additionally fall as matches develop into extra lopsided.
The failure just 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 appropriately determine balanced matches as extra draw-prone, however they don’t elevate the draw likelihood sufficient. In consequence, the mannequin can acknowledge draw threat with out usually choosing a draw because the probably final result. This reconciles the obvious contradiction between affordable draw calibration and weak draw recall: the possibilities transfer in the precise course, however often not far sufficient to win the argmax determination, that being to select the category with the very best predicted likelihood.

Characteristic Significance
As you would possibly count on, an important function for our mannequin is the ranking 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 believe it is a good time to debate dataset dimension and mannequin alternative. Usually, the bigger and extra complicated the dataset, the extra cause we’ve got to decide on a extra sophisticated mannequin. As we noticed on this instance, the beneficial properties from switching from regression to LightGBM have been very small; it is a good signal that making an attempt a extra complicated mannequin on this information 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 obvious: wer’re gonna want extra information if we need to get a greater prediction. Significantly player-level information—realizing if Neymar is sitting out is essential. The granularity of the info can also be vital if we need to change our forecast as the sport progresses.
Apendix
The code for the entire undertaking might be discovered on my GitHub
The info supply has a Inventive Commons CC0-1.0 license
make_team_clean <- operate(team_name) >
stringr::str_squish()
- 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.

