Roy Irani | Assignment 2 | Data Science Course — April 2026
Project Overview
Can we predict a football player's market value based on their in-game attributes?
This project builds a full machine learning pipeline on the FIFA 23 Complete Player Dataset (Kaggle), predicting value_eur — a player's real-world market value in Euros. The pipeline covers data cleaning, exploratory analysis, feature engineering, clustering, regression modeling, and classification.
Market value is heavily right-skewed — the vast majority of players are worth under €5M, while a small elite command €100M+
Overall rating is the strongest predictor of value, but the relationship is non-linear — elite ratings (85+) carry exponentially higher value
Players peak between ages 25–29 — value rises sharply in early 20s and declines after 30
Top 5 leagues command a value premium — Premier League and La Liga players are consistently valued higher than players with the same rating in lower leagues
Attackers and central midfielders hold the highest median market values by position
Overall Rating vs Market Value
Overall Rating vs Market Value
Age vs Market Value
Age vs Market Value
Preferred Foot Analysis
Player Count by Preferred Foot
Median Market Value by Preferred Foot
Young Players — Potential vs Market Value
Potential vs Market Value (Under 23)
BONUS: Domain Analysis
Position vs Market Value
Median Market Value by Position
League Premium
Market Value by League
Feature Engineering
Feature
Description
physical_index
Combined sprint speed + strength + jumping
mental_index
Combined composure + vision + aggression
growth_potential
Potential minus overall — room to improve
is_peak_age
Binary flag for players aged 25–29
overall_squared
Captures the exponential value curve at elite ratings
Clustering: Applied KMeans (k=4) to group players into archetypes, visualized with PCA 2D projection. Clusters mapped naturally to: elite superstars, first-team regulars, squad players, and young prospects.
Player Clusters — PCA 2D Projection
Regression Results
Baseline Model Performance
Baseline Predicted vs Actual
Model
MAE
RMSE
R²
Linear Regression (Baseline)
€2,533,555
€5,177,925
0.5418
Linear Regression (Engineered)
€2,226,587
€4,162,906
0.7039
Random Forest Regressor
€8,608
€114,114
0.9998
Gradient Boosting Regressor
€178,640
€399,824
0.9973
Winner: Random Forest Regressor — R² of 0.9998, average error of only €8,608 per player.
Regression Model Comparison
Feature Importance — Random Forest
Random Forest Feature Importance
Feature Importance — Gradient Boosting
Gradient Boosting Feature Importance
Classification Results
Players classified into 3 market value tiers using quantile binning:
Full notebook with all code, outputs, and visualizations
regression_model.pkl
Winning regression model (Random Forest) + scaler + feature list
classification_model.pkl
Winning classification model (Gradient Boosting) + scaler + feature list
Key Takeaways & Reflections
Feature engineering had a significant impact — R² jumped from 0.54 to 0.70 before any complex modeling. Tree-based models massively outperformed Linear Regression, confirming that player market value is an inherently non-linear problem. The league premium finding was the most compelling domain insight: players with identical overall ratings are valued differently based on which league they play in. Classification at 98% accuracy proved that once strong regression features are in place, tier classification becomes straightforward.
A note on tooling: During this project I used Claude Code (Anthropic's AI coding assistant) as a technical aid — helping with code structure, debugging, and implementation details. All analytical decisions, modeling choices, domain insights, and conclusions were my own.