- Benjamin Lofo Follo
- Arman Jahanpour
- Jialin Yang
This repository holds the code related to the study compiled in the 2021 report Predictive Analysis in League of Legends e-Sports Matches, written by the same authors towards the requirements of the COMP 432 Machine Learning class, given to students at Concordia University Montreal's Fall 2021 semester.
The deliverable collection contains the following documents:
Folders
data/
: Resources and files stored from the scripts for data collectiondata/json
: Example Endpoint Responses for the Riot API that are analyzed byextract_game_data.py
data/processed
: Final CSV training data setdata/raw
: Unprocessed files created byextract_game_data.py
data/csv
: List of match ids generated byfetch_game_ids.py
src/
: Executable Python filessrc/models/
: Joblib files for the models that have been trained by our ipynb filesrc/parsers/
: Parsers used withinextract_game_data.py
to prepare digestable tuple instancessrc/services/
: API scripts to communicate with third-party data services
Files
src/fetch_game_ids.py
: Connects to the Riot API to get all game ids from the available tiers and divisions.src/extract_game_data.py
: Scans all.csv
files inside the output folder, and calls the Riot API to fetch all information related to each match ids, which includes overall game statistics and game timeline.src/processing.ipynb
: Interactive Jupyter Notebook used to Preprocess the data collected inside thedata
folder.src/training.ipynb
: Interactive Jupyter Notebook used to train models against the preprocessed data inside thedata
folder.
The following packages are required to ensure all scripts run properly
- sklearn: Provides k-Means library for clustering and vectorizing text
- os: Read the files in the folder specified
A Riot API key is also needed for the API Client to work, which you can get here: https://developer.riotgames.com/
- Fetch the game ids with the following command
python src/fetch_game_ids.py
- Extract the game data using the following command (NOTE: this step may take very long (ETA:20 hours)
python src/extract_game_data.py
- Run the
processing.ipynb
to pre-process the data prior to analysis - Use the
training.ipynb
file to train the machine learning models
We have used these sources for bringing the project to life:
AlphaStar: Grandmaster level in StarCraft II using multi-agent reinforcement learning (For formatting layout of our report) https://deepmind.com/blog/article/AlphaStar-Grandmaster-level-in-StarCraft-II-using-multi-agent-reinforcement-learning
Riot Developer - Collecting data (Best practices on the Riot API) https://riot-api-libraries.readthedocs.io/en/latest/collectingdata.html