Skip to content

online-ml/lol-match-duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

League of Legends match duration forecasting

This is a simple project to demonstrate how creme may be used to build a "real-time" machine learning app. The idea is to predict the duration of LoL matches using information that is available at the start of the match. Once the match ends, the true duration is used to update the model.

Screenshots

home

matches

matches

Architecture

architecture

The goal of this project is to demonstrate that online learning is easy to put in place. Indeed predicting and training are both done inside web requests.

Usage

Development

Create an .env file with the following structure:

RIOT_API_KEY=https://developer.riotgames.com/

Next, create a local machine named dev and connect to it.

>>> docker-machine create dev
>>> eval "$(docker-machine env dev)"

Now you can build the stack.

docker-compose build

You can then start the stack.

docker-compose docker-compose.dev.yml up -d

You only have to build the stack once. However you have to rebuild it if you add or modify a service. You can now navigate to the following pages:

Run docker-compose down to spin the stack down.

⚠️ If you want to delete absolutely everything then run the following command.

docker container stop $(docker container ls -a -q) && docker system prune -a -f --volumes

Production

Create an .env file with the following structure:

SECRET_KEY=Keep_it_secret,_keep_it_safe
RIOT_API_KEY=https://developer.riotgames.com
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
REDIS_PASSWORD=redis
ADMIN_PASSWORD=creme

Run the following command to create a DigitalOcean droplet named prod. Replace the variables as you wish (for example $DIGITALOCEAN_SIZE could be s-1vcpu-1gb and region could be nyc3). Run docker-machine -h for more details.

>>> docker-machine create --driver digitalocean
                          --digitalocean-access-token $DIGITALOCEAN_ACCESS_TOKEN
                          --digitalocean-size $DIGITALOCEAN_SIZE
                          --digitalocean-region $DIGITALOCEAN_REGION
                          prod

You can now run docker-machine ls to see the instance you just created. Next run the following commands to deploy the app.

>>> eval "$(docker-machine env prod)"
>>> docker-compose build
>>> docker-compose up -d

Finally run docker-machine ip prod to get the IP address of the production instance. If you want to check out the logs run docker-compose logs --tail=1000.

For more information about deploying a Django app with Docker check out this down to earth post.

About

🎮 League of Legends match duration forecasting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published