All Projects → online-ml → lol-match-duration

online-ml / lol-match-duration

Licence: other
🎮 League of Legends match duration forecasting

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
shell
77523 projects
Dockerfile
14818 projects

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].