← Back Home

MACHINE LEARNING / PREDICTIVE MODELING

LoL Match Outcome Prediction Model

A Gradient Boosting machine learning model that predicts the outcome of League of Legends ranked matches before they begin using pre-game player statistics, ranked history, champion selections, and previous match data.

Project Goal

League of Legends, one of the world's most popular multiplayer games, uses a matchmaking system designed to create two evenly matched teams. As a result, many players believe that every ranked match begins with roughly a 50/50 chance of either team winning. This project challenges that assumption by examining whether measurable pre-game information can accurately predict the winning team before the match even begins.

What It Does

The model analyzes pre-game player information, including match history, champion selection, player-champion mastery, elo(rank), to predict whether Team 1 or Team 2 is more likely to win. In-game statistics such as kills, gold earned, towers destroyed, and objectives captured were intentionally excluded so that every result represents a true pre-game prediction.

Dataset

Historical ranked-match data collected through the Riot Games API

Complete matches

3,047

Training matches

2,437

Testing matches

610

Original features

230+

Each row represented one complete ranked match. The original dataset contained more than 230 features describing player statistics, champion selections, ranked history, and other information available before gameplay. The target variable,team1_win, was assigned a binary value of 1 for a Team 1 victory and 0 for a Team 2 victory.

Model Workflow

1. Match Data

Load historical ranked matches containing player statistics, ranked history, and champion information.

2. Preprocessing

Remove post-game information from the datase, replace missing values and convert categorical information into numerical features using one-hot encoding.

3. Model Training

Train a Gradient Boosting classifier using an 80/20 split and five-fold cross-validation.

4. Evaluation

Evaluate and test model on unseen matches, recording accuracy, precision, recall, F1 score, feature importance, and a confusion matrix.

Model Performance

Final evaluation on 610 previously unseen matches

Accuracy

71.97%

Precision

71.74%

Recall

74.28%

F1 Score

72.99%

Five-fold cross-validation accuracy

70.62%

± 0.71% standard deviation

The model correctly predicted the winning team in nearly three out of every four matches. Its similar accuracy, precision, recall, and F1 results indicate balanced performance rather than relying heavily on predictions for only one team.

Confusion Matrix

The confusion matrix shows how the model classified the 610 unseen matches in the testing dataset.

Predicted Team 1
Predicted Team 2
Actual Team 1

231

Correct Team 1 predictions

80

Predicted as Team 2

Actual Team 2

91

Predicted as Team 1

208

Correct Team 2 predictions

The model correctly classified 231 Team 1 victories and 208 Team 2 victories. The relatively balanced number of incorrect classifications suggests that the model did not show a significant bias toward predicting either team.

Tech Stack

Python
Scikit-learn
Pandas
NumPy
Joblib