Dota 2 machine learning python

Dota 2 machine learning python

Dota 2 machine learning python

Dota 2 machine learning python

A DOTA 2 hero recommendation engine for Stanford’s CS 229 Machine Learning course.

Our final report, which includes a full analysis of our project and our results, can be found here: Download Final Report

Where’s the Live Demo?

Unfortunately, given the way we used the scikit-learn k-nearest neighbors model with a custom distance/weight function (see final report above), we are not able to provide a heroku-based live demo. It might be possible to provide a live demo via a Linode/EC2 node, but that would be cost-prohibitive for us at this time.

Everything has been tested to work on Mac OSX 10.8. To download our project and run the code locally, follow the following procedure:

We use VirtualEnv to help facilitate getting setup on a new machine. There are a number of ways of installing it, depending on your operating system.

GFortran is required to install scipy. If you’re running Mac OSX, we recommend using Homebrew to install GFortran via its gcc formula:

MongoDB, Database Backup, and Environment Variables (optional for just running recommendation engine)

The data on Dota 2 matches we collected was stored in a MongoDB database. To extract the data to train new models, you must first install MongoDB. Then, download the backup of our database and restore it using this tutorial.

Also, our data collection script, dotabot2, uses a few environment variables for configuration so that these sensitive variables are not stored in the public repository. Therefore, you must initialize the following environment variables:

You may find it helpful to add these commands to your bash profile in your home directory so they are automatically executed each time you open a new terminal window.

Clone the Repository

From inside the repository root folder, initialize VirtualEnv by running:

This creates a new folder in the directory called “venv.” You only need to do this once. Don’t worry about ever accidentally adding this folder to the repository. There’s an entry for it in the. gitignore file.

Next, activate the VirtualEnv by running:

You should now see “(venv)” as part of your terminal prompt, indicating you are now inside your VirtualEnv. Note that closing the terminal window deactivates VirtualEnv, so you must run source venv/bin/activate each time you open a new terminal window for development.

Installing required packages

Now that you’re in VirtualEnv, run the following command to automatically install all of the Python modules that are required:

Running the web app

From the root folder of the project, run:

This starts the Flask web app, which you can view in a web browser at http://127.0.0.1:5000.

Running the recommendation engine via the command line

From the root folder of the project, run:

This (by default) uses the k-nearest neighbors algorithm to perform a hard-coded hero recommendation query. See the main function of engine. py for more details.

Contributions and Feedback

Feel free to submit a pull request if you are interested in continuing development. Sadly, we will probably not develop the project further for the foreseeable future. You can also contact us via email using the addresses in the final report (see above).

Dota 2 machine learning python

Leave a comment