Our inspiration for this technology stems from our interest in another field: sports. We played around with ideas about making a neural net to predict the outcome of sporting events. This proved to be difficult as a league such as the NBA has a fairly minuscule relevant data set from which to draw, and it would be prohibitively small to train. As a result, we shifted our attention to the insanely popular and emerging platform of E-Sports. The dominant E-Sport at the moment is called League of Legends, and with a limited cast of 138 characters and millions of recent, significant data points from which to draw, our new task became clear.

What it does

The champion chooser determines, given two team compositions, which team will most likely win the match. The user selects the team compositions on the front-end, and the prediction is done using TensorFlow. Our TensorFlow model was trained using around 50,000 previous matches played, gathered from the top 1% skilled players worldwide. Once trained, it was used to predict match outcomes given the team compositions of each team. Our engine predicts the outcome of a game correctly with an accuracy of 71%.

How we built it

The front-end was created using React.js, Javascript, HTML, and CSS. The React state was set up to keep track of the current champions selected, so that when the Predict button was pressed, this data could be sent to our back-end. Our back-end was created in Node.js and runs a Python script containing the TensorFlow model. In terms of TensorFlow, we first called and organized information from the RiotGames API to get the previous match data. After generating the files contain training data, we used a DNN and linear combined model in TensorFlow to train a classifier for predicting match outcomes. Specifically, the features were whether each champion was used for the player and the opponent, and the labels were whether the player won the game.

Challenges we ran into

One major challenged we faced was learning how to use TensorFlow. None of us were familiar with the framework to begin with, so it took a while to understand the process of using it to train our own custom model. Another significant challenge we faced involved linking the back-end, using Node.js, and the front-end, using React.js.

Accomplishments that we're proud of

-Batch scripting in Python to aggregate a large-enough, correctly-formatted dataset to train our TensorFlow model -Understanding how to use the TensorFlow technology and identifying what our features and labels were -Using React.js with a Node.js backend running python code

What we learned

We all got a pretty good understanding of how to use TensorFlow and what sort of dataset we need to provide. Certain things like the time it takes to generate the dataset and train the model are things we would never know without experiencing it first hand. Another pitfall we know to avoid in the future is using Node.js to run python code with a React.js frontend. It was a mistake, and we should have probably used Flask, but now we know and hackathons are about learning!

What's next for League of Legends Champion Chooser

First, we could add more features to the machine learning model, as the RiotGames API provides us with a lot more information than just the champions played. Also, we could try to implement a real-time system where we can predict win-rate based on turns being played out currently. Finally, we could provide more information to the player, like the next best pick of champion given the current combination of champions in order to give players more guidance.

Built With

Share this project: