Let's build a machine learning model to predict the outcome of the World Cup final happening tomorrow. So tomorrow, Spain and Argentina will face off in the 2026 World Cup final and everyone seems to have their opinions on who's going to win. But instead of today, we're building a multi-class classification ensemble model on this Kaggle dataset to predict the winner. In plain English, that just means we make two different prediction models: one that finds a straightforward and one that finds a more complicated one to estimate three probabilities: the chance of Spain winning, Argentina winning, and a draw. The result might surprise you. I started with five connected datasets containing 50,000 datasets, nearly 48,000 individual goals, detailed statistics from the 2026 World Cup and more. However, I could not simply give raw data to the model because a list of old scores necessarily doesn't describe how strong a team is going into a particular match. Instead, I moved through every game chronologically and created a snapshot that would have been known before the game began. For each team, I created an Elo rating, which increases when a team defeats a stronger opponent and decreases when it loses, like its points, goal difference, etc., across the previous five matches. I also included how strong their opponents were, how many days the athletes had to recover, how many different players had been scoring and how often the team had late goals or penalties. Most importantly, the model never receives statistics from the match it is trying to predict, even though the final does appear in its score, and the model stops learning after the semi-finals, which happened on July 15th. Then I created two different models. First, logistic regression focuses on the broad relationship between team strength and match outcomes, while gradient boosting can identify those more complicated patterns that the first model may miss. Instead of just choosing one arbitrarily, I tested different combinations and kept the blend that produced the strongest predictions on newer matches. I also avoided randomly splitting the data because that could let information from the future impact predictions about the past, which would be data leakage. Instead, I trained on older matches and then evaluated on about 3600 games from 2023 through the start of this World Cup. That chronological test, the model correctly predicted the match outcome about 61.1% of the time, compared with 47% for a baseline that just always predicts the most common outcome. I even built a second model using the detailed 2026 statistics, including shots, possession, corners, etc. However, when I tested those features on knockout rounds, they actually made the predictions worse. So logically, the final model gave them 0.8. That might sound disappointing, but honestly, rejecting information that does not improve performance is much better than forcing it into the model just because the final is being played at a neutral location. Prediction with teams in both orders and then averaged the result, that Spain did not receive an artificial advantage just because it was listed as the home team. Now it's time for the most exciting part, the results. So, before a possible penalty shootout, the model gives Spain a 40.1% chance of winning, and Argentina a 28.5% chance of winning, and a 31.4% chance that the match remains tied. However, Argentina's penalty history changes the picture considerably. If the final reaches a shootout, the model gives Argentina a 63.4% chance of winning. After evaluating every possible path to victory, the model gives, drum roll please, Spain a 51.6% chance of becoming the world champions and Argentina a 48.4% chance. So the model predicts that Spain will win, but by one of the smallest margins. And with that, save this video for after the game. Let me know who you're rooting for in the comments and follow for more. See you in the next one.