A data-driven approach to predict pass counts in upcoming matches using historical performance metrics across multiple leagues.
Our analysis is based on a comprehensive dataset of 4,414 matches spanning six major football leagues:
Each match provides 31 statistics per team plus 31 for their opponent, with one full season of data per league.
Fundamental statistics of key actions and occurrences during a game, such as xg, goals, passes.
Predicting the number of passes by the main team in the next match.
league_code, opp_team_code, and season_code, are converted to binary format where each category is represented by a separate column.16 variables capturing average performance of the team's last 3 matches
attacks_rolling, counter_attacks_rolling, corners_rolling, crosses_rolling, free_kicks_won_rolling, goal_kicks_rolling, goals_rolling, offsides_rolling, passes_acc_rolling, passes_forwards_rolling, passes_in_final_third_rolling, passes_long_rolling, passes_short_rolling, possessions_duration_rolling, saves_rolling, and xg_rolling.
10 variables capturing average stats of the team's last 3 opponents
opp_corners_rolling, opp_dribbles_rolling, opp_free_kicks_won_rolling, opp_interceptions_rolling, opp_offsides_rolling, opp_passes_forwards_rolling, opp_passes_in_final_third_rolling, opp_passes_short_rolling, opp_shots_on_rolling, and opp_throw_ins_rolling.
3 categorical variables describing match context, always included regardless of performance
tourament_id, opp_team_id, and season_id.
We evaluated the performance of our regression models using Root Mean Squared Error (RMSE) and R-squared (R²).
Stable performance across both training and testing datasets, indicating a good balance without significant overfitting.
Slight increase in RMSE and decrease in R² on the test set, suggesting minor overfitting.
Severe overfitting, with near-perfect fit on the training data (RMSE ≈ 0, R² ≈ 1.00) but extremely poor generalization on the test set (huge RMSE, negative R²).
Decision trees predict outcomes by partitioning the predictor space into distinct regions, assigning each region the mean response value of its observations. This is achieved through recursive binary splitting to minimize prediction error (RSS).
Begin with all observations in a single region at the tree's root.
Next, evaluate every predictor () and possible split point (), selecting the split that minimizes Residual Sum of Squares (RSS).
Apply the splitting process to each new child node created.
Splitting halts when a predefined maximum depth (i.e., the maximum number of splits from rood node to any terminal node) is reached.
Train trees of varying depths (1 to 20), compute test set RMSE for each, and select the depth with the lowest test RMSE to balance complexity and predictive accuracy.


Predicted Real Madrid's pass count for a hypothetical upcoming match based on their most recent 3 matches:
For Real Madrid's next match with Barcelona

Limitation: Stepwise selection is a greedy, discrete method that may miss the globally optimal set of predictors.
Improvement: Regularisation methods (e.g., Ridge or Lasso) offer a more systematic approach, balancing fit and complexity globally by shrinking coefficients toward zero.
Limitation: Higher-degree polynomials explode in terms of feature count (e.g., 5535 terms for degree 3), causing overfitting in train set but oscillate wildly in test set.
Improvement: Generalised Additive Models (GAMs) can capture non-linear relationships through smooth functions for each predictor.
Limitation: The tuning of maximum depth is simplistic, leading to potential overfitting or underfitting. DT is also unstable.
Improvement:
Limitation: sensitive to how data is split (e.g., 80/20)
Improvement: Use k-fold cross-validation (e.g., 5- or 10-fold) to better evaluate model performance across different subsets of data.
Forecasting Team Passes in Football Matches