Machine learning project for predicting football player market value in EUR from tournament performance, physical attributes, position, and match statistics.
The project contains two baseline models:
RandomForestRegressorinsrc/train.pyGradientBoostingRegressorinsrc/train1.py
Current local results:
| Model | MAE | R2 |
|---|---|---|
| Baseline mean prediction | 17,635,635 | - |
| Random Forest | 6,266,188 | 0.761 |
| Gradient Boosting | 8,768,228 | 0.664 |
FIFAPlayerPrices/
├── data/
│ ├── raw/
│ │ └── player_performance.csv
│ └── processed/
│ └── players_clean.csv # generated locally
├── models/
│ ├── player_price_model.pkl # generated locally
│ └── gradient_boosting_player_price_model.pkl # generated locally
├── notebook/
│ └── fifa_player_price_prediction.ipynb
├── src/
│ ├── features.py
│ ├── paths.py
│ ├── prepare_data.py
│ ├── predict.py
│ ├── train.py
│ └── train1.py
├── .gitignore
├── README.md
└── requirements.txt
Generated processed data and model files are ignored by Git because they can be recreated locally and model files can be large.
Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activateInstall dependencies:
pip install -r requirements.txtPrepare the cleaned dataset:
python src/prepare_data.pyTrain the Random Forest model:
python src/train.pyTrain the Gradient Boosting model:
python src/train1.pyRun example predictions with both trained models:
python src/predict.pyThe model uses:
- player position
- age, height, and weight
- shooting, passing, dribbling, defensive, and goalkeeper statistics
- physical metrics such as distance covered, sprint distance, top speed, stamina
- tournament-level performance metrics
The target column is:
market_value_eur
The Random Forest model currently performs better than Gradient Boosting on the same train/test split. A good next improvement would be to train on log(market_value_eur) because football market values are usually highly skewed.