Performance Efficiency Rating (PER) using Machine Learning
Game
League of Legends
Goal
This project aims to evaluate player performance in League of Legends by calculating a Performance Efficiency Rating (PER) metric using data from the Riot Games API. The notebook explores data loading, preprocessing, model training, and evaluation to achieve this objective.
Tools used
-
Programming Language: Python
-
Data Collection: League of Legends API (Riot Games API)
-
Data Analysis: Pandas, NumPy, Scikit-learn,
-
Visualization: Tableau, Matplotlib, Seaborn
-
Model: XGBoost

Dashboard
The following dashboard provides a comprehensive analysis of Player Efficiency Rating (PER) for both summoners and champions in League of Legends. The layout is designed to give users an in-depth look at individual and average performances over time, with additional insights into top players and champions from 100 different matches based on the highest League Points (LP).
Note: Future iterations will allow the user to analyze their own insights by inputting their summoner's name.
Key Analysis and Takeaways
Feature Extraction and Engineering
Minute-by-Minute Analysis
The extraction of detailed, minute-by-minute statistics from the match timeline allows for granular analysis of player performance and game dynamics.
Player Efficiency Rating (PER)
The calculation of the PER stat provides a composite metric that captures overall player effectiveness.
Insights into Player Performance
Contextual Understanding
By integrating contextual information such as champion names, roles, and match outcomes, the analysis provides a deeper understanding of player performance in different game scenarios.
Behavioral Patterns
The detailed timeline data helps identify behavioral patterns and strategies used by top players, offering insights into successful gameplay tactics.
Practical Applications
Coaching and Training
The insights derived from the analysis can be used by coaches to develop targeted training programs, focusing on areas that have the most impact on performance.
Player Self-Assessment
The proposed web application would allow players to submit their summoner names and receive personalized PER scores, helping them understand their performance relative to others and identify areas for improvement.
Predictive Modeling
High Model Accuracy
The XGBoost model achieved a high test set accuracy of 84.59%, indicating that the features used are effective predictors of match outcomes.
Feature Importance
Analysis of feature importance reveals which in-game statistics are most influential in determining match outcomes. This information can guide player training and strategy development.
Potential for Real-Time Analytics
Dynamic Tracking
The methodology developed can be adapted for real-time tracking and analysis of ongoing matches, providing immediate insights and enabling dynamic strategy adjustments.
Visualizations
Queries
Top Performers in Games Longer Than Average Duration
WITH avg_game_length AS (
SELECT
ROUND(AVG(max_minute)::NUMERIC, 2) AS avg_duration
FROM (
SELECT
MAX(minute) AS max_minute
FROM
stats_per
GROUP BY
match_id
) AS game_duration
)
SELECT
summoner_name,
champion_name,
ROUND(AVG(per)::NUMERIC, 2) AS avg_performance
FROM
stats_per
WHERE
match_id IN (
SELECT
match_id
FROM
stats_per
GROUP BY
match_id
HAVING MAX(minute) > (SELECT avg_duration FROM avg_game_length)
)
GROUP BY
summoner_name, champion_name
ORDER BY
avg_performance DESC;
----------------------------------------------------------------------------------------------------------------------------
"white space" "Irelia" 16.40
"white space" "Fizz" 15.82
"Birds cant fly" "Teemo" 15.33
"kimmy" "Hecarim" 14.58
"white space" "Viego" 14.50
"Theoneyahate" "TwistedFate" 13.90
"CarlTheCarry" "Talon" 13.74
...
Next Steps

Model Optimization
Further fine-tuning of the predictive model can be undertaken to improve accuracy.

Advanced Analytics
Perform advanced statistical analysis and visualizations to uncover deeper insights.

Real-Time Analytics
Integrate real-time data feeds to enable live tracking and analysis of ongoing matches.

Feature Expansion
Incorporate additional features such as player communication, item build paths, and map control metrics.

Web Application Development
Create a web application that allows users to submit their summoner names and receive their own PER scores.