LoLwinner is a web-app that helps improve live betting returns by predicting match outcomes for the popular eSports video game League of Legends. It is estimated that online wagers on eSports this year alone will be ~$6B [1].
This is a project that I worked on during my fellowship at Insight Data Science.
LoLwinner consists of two main components:
- An offline machine learning analysis that includes scraping and processing match data, extracting engineered features, and pre-computing a binary classification model
- A real-time UI that fetches matches and analyzes them using the computed model
Data scrapers gather real match data from third party sources (Riot's API). This process takes considerable time in order to fetch a large amount of match data across a large number of player accounts.
Data scraping is a very ad-hoc process due to the dependency on external resources and their limitations. I can parallelize data ingestion by requesting different sets of data on different hosts. As a result, the results are bursty and fragmented.
In order to use the data, I batch my scraped data and push it over time to a suitable centralized location for processing and analysis.
This is where I actually analyze the match data. This Github repo contains this component.
I engineer intra-match features that are associated with positive performance. I train a binary classifier that has peak accuracy of ~84%. Included here is the analysis using a Logistic Regression model, which is the current production model.
The repo does not contain the additional analysis that was performed using Random Forest and Support Vector Machine classifiers (with randomized search to optimize hyperparameters). It is noted that the Logistic Regression and Random Forest models had similar performance, but Logistic Regression was ultimately chosen for its notably faster predictive speed, which allows the web-app to make low-latency predictions.
On the website, users can search for specific matches. It will dynamically pull match data and apply our precomputed model to analyze it.
- User requests a match to be analyzed
- If previously requested, the cached results are loaded and returned.
- Load match data from Riot (this is cached and reused)
- Analyze the match using our precomputed model
- Cache the results
- Return the results
Users can also search for a particular player, and the website will show the last five matches that the player has played. The user can then select to track one of these matches.
The website is currently hosted on AWS.
- Betting odds: Scraping betting odds from online bookmakers (I have already written a script that can automate this process for one of the largest betting websites)
- Additional features: Enriching data with pre-match data (e.g., from champions.gg, op.gg, legends.ai)
- Live match data: Subscribing to live match data feed from Panda Score
[1] Grove, Chris. Esports & Gambling: Where's the Action? (2016)
- Python
- Postgres
- scikit-learn
- AWS
- Flask
- Bootstrap