What is the average salary a forward at Manchester United earns? Who is the most similar player to 2017 Neymar in the 2023 Premier League season? We didn't know the answers to these questions either until we built PeakPerformance.
PeakPerformance is an AI-powered football analytics platform designed to predict seasonal performance, predict salaries, suggest similar players to a particular player,simulate player contract negotiations, using machine learning and reinforcement learning.
It features an interactive Streamlit dashboard with five fully-functional pages. Explore the deployed web app here: peakperformance
- Introduction
- Repository Structure
- Installation & Setup
- The Team (Contributors)
- Features & Pages Overview
- Dataset
- The SportsDB Integration
- Acknowledgments & References
- Show Your Support!
└── dataset
└── Ratings Combined
└── filtered_playerratingssalaries.csv
└── player_data_with_predictions.csv
└── thousandminsormore.csv
└── docs
└── in_class_user_stories
└── user_stories.md
└── technology_review
└── technology_review.md
└── design_spec.md
└── functional_spec.md
└── Interaction Diagram.png
└── milestones.md
└── Python Notebooks
└── peakperformance
└── home.py
└── pages
└── eda_salary.py
└── player_plot.py
└── player_profile.py
└── statmatch.py
└── the_negotiator.py
└── backend
└── train_model.py
└── tests
└── test_eda_salary.py
└── test_home.py
└── test_player_plot.py
└── test_player_profile.py
└── test_statmatch.py
└── test_the_negotiator.py
└── test_train_model.py
└── environment.yml
└── requirements.txt
└── README.md
- Python 3.11
- Streamlit
- All dependencies in
requirements.txt
Clone the GitHub repository to your machine using:
git clone git@github.com:akshan-main/peakperformance.gitEnter the project directory:
cd peakperformanceCreate a new conda environment:
conda env create -f environment.ymlActivate the environment:
conda activate myenvLaunch the Streamlit app:
streamlit run peakperformance/home.py✨ EDA & Salary Analysis
- Visualize player salaries across leagues, positions, and clubs.
- Interactive scatter plots (Rating vs Salary) and salary distribution charts.
- Understand league wage disparities and club-wise payroll structures.
🕸️ Player Performance Radar
- Select 1–10 players and compare them across chosen metrics.
- Dynamic radar charts using Plotly.
- Great for role profiling and visual comparisons.
🎯 Player Similarity Matching
- Ask questions like “Top 10 players similar to 2022 Messi in 2023 Bundesliga under 25.”
- Natural language queries + Query Parsing + Regular Expressions + cosine similarity.
- Focused on scouting, transfer targeting, and replacing players.
🔍 Player Profile Lookup
- Retrieve profile of football player.
- View predicted ratings over time.
- Chart displays career trajectory with rating trends.
💼 Contract Negotiator
- FIFA-style contract simulation with an RL agent (trained via Deep Q-Learning).
- Offer wages, adjust contract length, and receive counter-offers.
- Optimize strategic contract decisions by analyzing match performance, contract details, and market trends
- The RL agent simulates multi-season decision-making, helping clubs determine whether to extend a player’s contract
For the below mentioned datasets, we used player data from 2017/18 season to 2023/24 season.
- filtered_playerratingssalaries.csv: Used to train the reinforcement learning model.
- thousandminsormore.csv: Filtered ratings, salary data for players with more than 1000 minutes played.
- player_data_with_predictions.csv: Player data with upcoming season ratings prediction (found using XGBoost).
FBref website - Player performance metrics data
Sofascore website - Player seasonal ratings data
Capology website - Player yearly and weekly salary data
Our project uses TheSportsDB to retrieve basic football player information such as photos, nationality, and position. This data is then displayed on our Player Profile page.
- Free & Public: It offers a free, public API key (
API_KEY = "3") that doesn’t require secrecy. - Rich Data: Provides an array of data points (e.g.
strPlayer,strTeam,strNationality) without additional overhead. - Simple Integration: Straightforward to call via HTTP requests.
-
The aforementioned data sources.
-
Statsbomb & community for radar chart inspiration.
-
Streamlit, Scikit-learn, PyTorch, Altair, Plotly, Matplotlib documentations.
Enjoy using PeakPerformance! If you find this project useful or insightful, please give the repository a star on GitHub. For any issues or enhancement requests, open an issue – we’d love to continue improving the tool with your feedback. Join us in harnessing the power of AI and data to reach new heights in football analytics.