The Explainability of Machine Learning Algorithms for Victory Prediction in the Video Game Dota 2 †
Abstract
1. Introduction
2. State of the Art
3. Methodology
- Data extraction and preprocessing: Use of the OpenDota API to extract game data, analysing hero selections, and labelling games as wins or losses.
- Model training: Use of logistic Regression models, Random Forest, and Gradient Boosting models and evaluation of models using cross-validation techniques and performance metrics such as precision, recall, and F1-score.
- Comparison of parameter configurations: Automatic training and evaluation of models with different parameter configurations to identify the optimal configuration.
- Visualization of Results: Generation of graphs to compare the performance of different models and configurations and use of SHAP graphs to better understand how the model works and which variables are more relevant for the prediction.
3.1. Dataset Composition
- Identifiers of the players;
- Selected heroes;
- Game statistics (kills, assists, gold, etc.);
- Game results (victory or defeat).
3.2. Predictive Models Considered
- Logistic Regression: A linear model that is commonly used for binary classification problems [21].
- Random Forest: A set of decision trees that improves accuracy by combining multiple trees [22].
- Gradient Boosting: A boosting method that creates robust prediction models by combining several weak models [23].
3.3. Evaluation and Explainability of the Models
- Accuracy: Proportion of correctly predicted instances out of the total instances;
- Precision: Proportion of correctly predicted positive instances out of all predicted positives;
- Recall: Proportion of correctly predicted positive instances out of all actual positives;
- F1-score: Harmonic average between precision and recall.
3.4. Interpretation of SHAP Values
- Feature importance: SHAP values allow one to identify which features are more important for the model. A larger range of SHAP values for a specific feature implies a greater influence of this feature on the predictions.
- Positive or negative contribution: The colours and position in the chart indicate whether a feature contributes positively or negatively to a prediction. For example, in a SHAP summary chart, dots in red indicate features with a high value (in this case, this would indicate cases where a certain hero has been selected), while dots in blue indicate features with a low value, i.e., a certain hero has not been selected. The position on the horizontal axis shows whether this contribution is positive or negative to the outcome.
- Distribution of effects: The dispersion of the points on the horizontal axis indicates the variability in the importance of the feature for different predictions. A larger dispersion suggests that the feature has varying impact in different cases.
4. Results
4.1. Dataset Analysis
4.2. Results of the Machine Learning Algorithms
4.3. Analysis of the SHAP Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Bursztein, E. I am a legend hacking hearthstone using statistical learning methods. In Proceedings of the Computational Intelligence and Games Conference, Santorini, Greece, 20–23 September 2016; IEEE: New York, NJ, USA, 2016. [Google Scholar]
- Arrieta, A.B.; Rodríguez, N.D.; Ser, J.D.; Bennetot, A.; Tabik, S.; Barbado, A.; García, S.; Gil-Lopez, S.; Molina, D.; Benjamins, R.; et al. Explainable Artificial Intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Inf. Fusion 2020, 58, 82–115. [Google Scholar] [CrossRef]
- Gutiérrez, J.A.G.; Ordoñez, C.R.H.; Flores, M.A.V.; Zenteno, M.A.Z. Predicción de victoria en videojuego competitivo con Deep Learning. Res. Comput. Sci. 2022, 151, 47–57. [Google Scholar]
- Ontañón, S.; Synnaeve, G.; Uriarte, A.; Richoux, F.; Churchill, D.; Preuss, M. A Survey of Real-Time Strategy Game AI Research and Competition in StarCraft. IEEE Trans. Comput. Intell. AI Games 2013, 5, 293–311. [Google Scholar] [CrossRef]
- Silva, A.L.C.; Pappa, G.L.; Chaimowicz, L. Continuous Outcome Prediction of League of Legends Competitive Matches Using Recurrent Neural Networks. In Proceedings of the XVII SBGames, Foz do Iguacu, PR, Brazil, 29 October–1 November 2018. [Google Scholar]
- Do, T.D.; Wang, S.I.; Yu, D.S.; McMillian, M.G.; McMahan, R.P. Using Machine Learning to Predict Game Outcomes Based on Player-Champion Experience in League of Legends. In Proceedings of the FDG’21: The 16th International Conference on the Foundations of Digital Games 2021, Montreal, QC, Canada, 3–6 August 2021; Fowler, A., Pirker, J., Canossa, A., Arya, A., Harteveld, C., Eds.; ACM: New York, NY, USA, 2021; pp. 47:1–47:5. [Google Scholar] [CrossRef]
- Santos, J.M. Counter Strike Matches Result Prediction. 2020. Available online: https://github.com/jefersonmsantos/counter_strike/blob/master/machine_learning_model/Machine%20Learning%20prediction%20model.ipynb (accessed on 28 February 2025).
- Baek, I.; Kim, S.B. 3-Dimensional convolutional neural networks for predicting StarCraft results and extracting key game situations. PLoS ONE 2022, 17, e0264550. [Google Scholar] [CrossRef] [PubMed]
- Junior, J.B.S.; Campelo, C.E.C. League of Legends: Real-Time Result Prediction. arXiv 2023, arXiv:2309.02449. [Google Scholar] [CrossRef]
- Mnih, V.; Kavukcuoglu, K.; Silver, D.; Rusu, A.A.; Veness, J.; Bellemare, M.G.; Graves, A.; Riedmiller, M.A.; Fidjeland, A.; Ostrovski, G.; et al. Human-level control through deep reinforcement learning. Nature 2015, 518, 529–533. [Google Scholar] [CrossRef] [PubMed]
- Schulman, J.; Wolski, F.; Dhariwal, P.; Radford, A.; Klimov, O. Proximal Policy Optimization Algorithms. arXiv 2017, arXiv:1707.06347. [Google Scholar] [CrossRef]
- Silver, D.; Hubert, T.; Schrittwieser, J.; Antonoglou, I.; Lai, M.; Guez, A.; Lanctot, M.; Sifre, L.; Kumaran, D.; Graepel, T.; et al. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science 2018, 362, 1140–1144. [Google Scholar] [CrossRef] [PubMed]
- OpenAI. OpenAI Five: Defeating the World Champions in Dota 2 with Self-Play Reinforcement Learning. 2019. Available online: https://openai.com/index/openai-five/ (accessed on 14 November 2024).
- Vinyals, O.; Babuschkin, I.; Czarnecki, W.M.; Mathieu, M.; Dudzik, A.; Chung, J.; Choi, D.H.; Powell, R.; Ewalds, T.; Georgiev, P.; et al. Grandmaster level in StarCraft II using multi-agent reinforcement learning. Nature 2019, 575, 350–354. [Google Scholar] [CrossRef] [PubMed]
- Tao, J.; Xiong, Y.; Zhao, S.; Wu, R.; Shen, X.; Lyu, T.; Fan, C.; Hu, Z.; Zhao, S.; Pan, G. Explainable AI for Cheating Detection and Churn Prediction in Online Games. IEEE Trans. Games 2023, 15, 242–251. [Google Scholar] [CrossRef]
- Drachen, A.; Sifa, R.; Bauckhage, C.; Thurau, C. Guns, swords and data: Clustering of player behavior in computer games in the wild. In Proceedings of the 2012 IEEE Conference on Computational Intelligence and Games (CIG), Granada, Spain, 4–7 September 2012; pp. 163–170. [Google Scholar] [CrossRef]
- Rothmeier, K.; Pflanzl, N.; Hüllmann, J.A.; Preuss, M. Prediction of Player Churn and Disengagement Based on User Activity Data of a Freemium Online Strategy Game. IEEE Trans. Games 2021, 13, 78–88. [Google Scholar] [CrossRef]
- Lipton, Z.C. The mythos of model interpretability. Commun. ACM 2018, 61, 36–43. [Google Scholar] [CrossRef]
- Rudin, C. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nat. Mach. Intell. 2019, 1, 206–215. [Google Scholar] [CrossRef] [PubMed]
- Grandien, N.; Delfosse, Q.; Kersting, K. Interpretable end-to-end Neurosymbolic Reinforcement Learning agents. arXiv 2024, arXiv:2410.14371. [Google Scholar]
- Hosmer, D.W.; Lemeshow, S. Applied Logistic Regression, 2nd ed.; Wiley: Hoboken, NJ, USA, 2000. [Google Scholar] [CrossRef]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Friedman, J.H. Greedy Function Approximation: A Gradient Boosting Machine. Ann. Stat. 2001, 29, 1189–1232. [Google Scholar] [CrossRef]
- Mage. How to Interpret Machine Learning Models with SHAP Values. 2023. Available online: https://dev.to/mage_ai/how-to-interpret-machine-learning-models-with-shap-values-54jf (accessed on 28 February 2025).
- García-Sánchez, P.; Tonda, A.P.; Leiva, A.J.F.; Cotta, C. Optimizing Hearthstone agents using an evolutionary algorithm. Knowl. Based Syst. 2020, 188, 105032. [Google Scholar] [CrossRef]
- Developers, S. Basic SHAP Interaction Value Example in XGBoost. 2024. Available online: https://shap.readthedocs.io/en/latest/example_notebooks/tabular_examples/tree_based_models/Basic%20SHAP%20Interaction%20Value%20Example%20in%20XGBoost.html (accessed on 28 February 2025).
Metric | Random Forest | Gradient Boosting | Logistic Regression |
---|---|---|---|
Accuracy (Train/Test split) | 0.9800 | 0.8955 | 0.6588 |
Accuracy (cross-validation) | 0.9837 | 0.8653 | 0.6562 |
Precision | 0.9795 | 0.8916 | 0.6656 |
Recall | 0.9869 | 0.9383 | 0.8560 |
F1-Score | 0.9832 | 0.9143 | 0.7489 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Losada-Rodríguez, J.; Castillo, P.A.; Mora, A.; García-Sánchez, P. The Explainability of Machine Learning Algorithms for Victory Prediction in the Video Game Dota 2 . Comput. Sci. Math. Forum 2025, 11, 26. https://doi.org/10.3390/cmsf2025011026
Losada-Rodríguez J, Castillo PA, Mora A, García-Sánchez P. The Explainability of Machine Learning Algorithms for Victory Prediction in the Video Game Dota 2 . Computer Sciences & Mathematics Forum. 2025; 11(1):26. https://doi.org/10.3390/cmsf2025011026
Chicago/Turabian StyleLosada-Rodríguez, Julio, Pedro A. Castillo, Antonio Mora, and Pablo García-Sánchez. 2025. "The Explainability of Machine Learning Algorithms for Victory Prediction in the Video Game Dota 2 " Computer Sciences & Mathematics Forum 11, no. 1: 26. https://doi.org/10.3390/cmsf2025011026
APA StyleLosada-Rodríguez, J., Castillo, P. A., Mora, A., & García-Sánchez, P. (2025). The Explainability of Machine Learning Algorithms for Victory Prediction in the Video Game Dota 2 . Computer Sciences & Mathematics Forum, 11(1), 26. https://doi.org/10.3390/cmsf2025011026