Soccer Prediction Model (SPM)

Predicting non-penalty goals from season stats · Big-5 European leagues · Martin Ngoh

Problem statement

Transfer fees are high and a wrong signing costs millions. This model predicts a player's non-penalty goals from season statistics, so clubs can narrow the search for forwards.

Dataset
Raw records
21,863
before cleaning
Players
2,786
after deduplication
Modelling sample
829
players with 2+ non-penalty goals
Features
40
after cleaning
Leagues
5
Big-5 European leagues
Countries
104
unique nationalities

Non-penalty goals per player

All 2,786 players. 1,470 scored none. Faded bars (0 and 1) were excluded, leaving 829 for modelling.

Feature correlations

Pearson r with non-penalty goals, 829-player modelling sample, top 10 features.

Goals by position

Mean non-penalty goals per player, positions with 50+ players.

Scoring rate by country

Non-penalty goals per 90 as a ratio to the overall rate (1.0 = average). Top 12 of the 29 nationalities with 20+ players.
Pipeline
01

Data cleaning

Deduplicate 21k records, rename 30+ columns, cap outliers at the 99.9th / 5th percentile

02

EDA

129 scatter plots vs goals, 129×129 correlation heatmap, descriptive statistics

03

Feature engineering

log(x+1) on the target and all numeric features, one-hot encode categoricals, PCA at 0.95 variance

04

Modelling

8 models, grid search on tree & boosting models, 80/15/5 train/val/test split, k-fold CV

05

Evaluation

MAE, MSE, RMSE, R². Best: Lasso, R² = 0.680

Model performance

The target is log(non-penalty goals + 1), so every error below is on that log scale.

RMSE by model

Lower is better. Linear models in red.

Predicted vs actual

Lasso, held-out test set (n=42). R²=0.680, RMSE=0.249.

Residuals

Lasso, prediction minus actual for the same 42 players. No trend.

R² by model

Variance explained on the test set. Higher is better.
Results table
ModelMAEMSERMSER²
Lasso (Elastic Net, L1)0.1980.0620.2490.680Best R²
Linear Regression0.1930.0630.2510.675Best MAE
XGBoost0.2290.0770.2770.604Good
Neural Network0.2410.0850.2920.560
CatBoost0.2430.0900.3000.535
LightGBM0.2470.0880.2970.545
Decision Tree0.2760.1150.3390.407
Random Forest0.2810.1090.3300.438
Key findings

Linear models win

Lasso and Linear Regression beat every tree-based and neural model. Lasso had the best R² (0.680) and RMSE (0.249), Linear Regression the best MAE (0.193).

Strong predictive signal

Player statistics explain 68% of the variance in log non-penalty goals on the test set, with a mean absolute error of 0.198.

Tree models underperform

Random Forest had the highest error (MAE=0.281) and the Decision Tree the lowest R² (0.407). Trees may be overfitting the log-transformed, PCA-reduced features.

Neural network convergence

5-layer network (50→40→30→20→10) with early stopping converged at epoch 28 of 1000. Test MSE=0.0854, no gain over linear models.

Data reduction

21,863 raw records reduced to 2,786 unique players, then to the 829 with 2+ non-penalty goals for modelling.

Cross-validation stability

Linear Regression 5-fold CV: mean RMSE 0.279 ± 0.015. Low variance, so the model generalises.

Limitations

Small test set (42 players), and only players with 2+ non-penalty goals. On the log scale an RMSE of 0.249 is about a 28% multiplicative error.

Best hyperparameters
Elastic Net
alpha=0.001
l1_ratio=1 (Lasso)
XGBoost
depth=1
lr=0.5 · n=100 · λ=9
LightGBM
depth=4
lr=0.1 · leaves=30 · n=200
CatBoost
depth=2
lr=0.5 · iter=60 · λ=6
Random Forest
depth=90
features=12 · n=100
Decision Tree
depth=4
criterion=poisson · leaf=10