Predicting the Outcome of a Multiplayer Online Battle Arena (MOBA) Match
Welcome back to another deep dive into the fascinating world of machine learning. This time, we’re stepping into the fast-paced, action-packed domain of MOBA gaming, where skilled players can make the difference between victory or defeat.
Project Overview
The primary focus of this machine learning project was to predict a player’s chances of winning a MOBA match based on their end-of-game statistics. However, the project’s scope went beyond just creating the models. It also involved developing a functional dashboard to visually represent the model’s results and predictions in a user-friendly format. We created two models for this purpose: one using a LASSO method and the other a Random Forest method. The final aim was to enable players to gain insights on their gameplay through the dashboard, and understand which game statistics to focus on for improving their winning chances.
Dataset and Preprocessing
The initial dataset was extracted from a popular MOBA game and contained end-of-match statistics from individual players. After cleaning, the final dataset had 70 features, including details about the player’s champion, the role they played, and various match statistics like kills, deaths, assists, etc.
Feature engineering was conducted to create additional valuable variables. Features like KDA (Kill Death Assist ratio) and Damage per Minute were added, resulting in a total of 82 features. The data was then cleaned and scaled for machine learning modeling.
Modeling
LASSO Model
The first model used for this project was the LASSO (Least Absolute Shrinkage and Selection Operator) model, which operates as a linear model with L1 regularization. The LASSO model was chosen because of its inherent ability to conduct feature selection.
The model was trained on different roles separately: Top, Jungle, Mid, ADC, and Support. This was done because different roles in a MOBA game play differently and their contribution to the match’s outcome can vary significantly.
The features that had a coefficient of zero were removed from the final features list, leading to a total of 12 features per role. After testing the model on unseen data, it managed to predict with an accuracy of 98%.
Random Forest Model
The second model used the Random Forest method. Random Forest is a classification algorithm comprising many decision trees for making a prediction. It was chosen because not all the features included in the dataset hold linear relationships with the target variable.
A nested cross-validation method was used to evaluate the machine learning model and to tune the hyperparameters. This resulted in the creation of thousands of models, which made the process computationally expensive and time-consuming but necessary to avoid bias and poor results when testing on independent data.
During the training of the model, the evaluation results showed an accuracy score of 96%. The model was then tested on unseen scraped data from 6 matches of a random player, with an accuracy score of 92%.
Dashboard Creation and Functionality
The dashboard was developed to allow the client to visually understand and interact with the results of the models. It is designed to display the list of statistics that can improve a player’s chances of winning. After a client inputs a champion and role on the sidebar, the dashboard displays the corresponding data, giving them insights into how they can enhance their gameplay.
The dashboard also displays the predicted match results based on player’s end-of-match statistics. This can aid a client in reviewing their games, offering a comprehensive understanding of how they won or lost a match.
Results
The project successfully met its objective of predicting a player’s chances of winning a match based on their end-of-game statistics. The random forest model was successful in making the correct prediction in 92% of the tested matches. The results could provide valuable insight to the client by showing what the result of the match should have been, if it was based solely off the player’s end of match statistics.
The LASSO model resulted in a list of features for each role in the game, which are linearly correlated to the team win. The client can gain insight into how they can improve their gameplay based up these results.
Learnings and Skills Acquired
This project provided an excellent opportunity to apply and enhance a variety of skills in data science, machine learning, and data visualization. Working with game datasets and understanding their nuances was a unique experience. Implementing different models like LASSO and Random Forest highlighted the importance of selecting the right modeling technique based on the nature of the data and the specific problem to be solved.
The use of nested cross-validation for model evaluation and hyperparameter tuning offered a deep dive into the robustness and intricacies of these techniques. This rigorous approach, despite being computationally demanding, was instrumental in ensuring unbiased model performance.
One of the most crucial aspects of this project was the creation of the dashboard. This task emphasized the importance of effective data visualization and communication in data science. It required additional skills like UI/UX design principles, knowledge of visualization libraries, and an understanding of how to connect a model’s output to a visual interface. It also highlighted the importance of iterative feedback in developing a user-friendly interface.
Lastly, this project combined the use of dashboards, models, and dynamic web scraping (using Python code) to enable the client to use the model on one of their own games. (The website platform used to gather player data is no longer functioning.)
Conclusion
In this project, we explored the intricate dynamics of a MOBA match using data analysis, machine learning, and data visualization. By creating the models and the interactive dashboard, we provided players with valuable insights and a tool to help them improve their game. This project exemplified how data science can be applied extensively, even in unexpected domains like online gaming, and underlined the importance of effectively communicating data through well-designed dashboards.
*** Unfortunately, the website hosting the player statistics used in this dashboard is no longer operational, and thus the dashboard is no longer useful for players at this time.