Skip to content

Latest commit

 

History

History
105 lines (76 loc) · 2.36 KB

File metadata and controls

105 lines (76 loc) · 2.36 KB

FIFA Player Price Prediction

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:

  • RandomForestRegressor in src/train.py
  • GradientBoostingRegressor in src/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

Project Structure

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.

Setup

Create and activate a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Usage

Prepare the cleaned dataset:

python src/prepare_data.py

Train the Random Forest model:

python src/train.py

Train the Gradient Boosting model:

python src/train1.py

Run example predictions with both trained models:

python src/predict.py

Features

The 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

Notes

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.