Skip to content

ealitten/we-predicted-that

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

we predicted that

We Predicted That

Welcome to We Predicted That's machine learning excellence!

Introduction | Description | Approach | Screen Shots | MVP | Features | Technologies | Installation | Demo video | Blog

Introduction

This repo details We Predicted That's "final week" machine learning project from the December 2017 Makers Academy cohort.

Our team:

Project Description

We defined our initial project aim as:

Making predictions using machine learning

Since we were all new to machine learning and data science, we started the project with a mini learning project: predicting who survives the sinking of the Titanic. This is a popular starting project for ML, and is a good introduction to the simpler ML algorithms. The challenge is a relatively straightforward binary classification problem - there are two outcomes: survived and died. We solved this using a logistic regression algorithm, using three columns from the Titanic dataset (age, sex and passenger class), achieving 80-82% accuracy of prediction. The titanic model and data can be found in the titanic folder.

Once we had solved the titanic challenge, we chose a main project: using a dataset of pokemon attributes and battles to predict the winner in a battle between any two Pokemon. The dataset was obtained from kaggle.

Have a look at the website and make as many guesses until your heart is content. (Please note the cloud can be slow to load so you may need to click the lets fight button and wait a sec when you first use it, but after that it will be great.)

Approach

Details on the technical implementation:

  1. Intro to Machine Learning & terminology
  2. Data munging
  3. Training the model
  4. Exporting and uploading the model to Google ML engine
  5. Building a web app in Django
  6. Linking up the web app on Heroku with the model

Have a look at our team blog for the teamwork side of things!

Demo

The pokemon predictor webiste is hosted on Heroku at https://we-predicted-pokemon.herokuapp.com/

N.B. On the free tier, Google ML engine nodes sleep after a few minutes without any requests. This means the first time you ask for a prediction, the node needs to be spun up and the response may be slow (~30s); however, subsequent requests should have more normal performance (<1 second).

Pick two Pokemon and see who will win

Watch a demo video

we predicted that

we predicted that

MVP

We defined our learning project MVP as:

Using Titanic survivor data, predict the survival outcome of passengers better than chance (50%).

The MVP for our main project was defined as:

Using the battle data and Pokemon attributes, predict the outcome of a battle with accuracy >75%

Features implemented

  • A pokemon battle model which predicts the outcome of a fight between two pokemon

    • Logistic regression method used for prediction
    • Accuracy of ~87%
    • Trained on a dataset of 40,000 outcomes, using 16 feature columns
    • Model hosted on Google ML engine for online prediction requests
  • A web app which provides an interface for the prediction model

    • The user can select two pokemon to fight and see the predicted outcome
    • The user can see images of the pokemon, and see their stats before the battle

Technologies / plaforms used

  • Python
  • TensorFlow - Machine learning library
  • Pandas - Data structure library
  • Django - Python web framework
  • Google ML engine - Managed service to host custom machine learning model
  • Heroku - Platform to deploy our Django web app

Installation/Requirements

  • python 3.6

All required packages can be installed by installing the pipenv library (pip install pipenv) and then running pipenv install in the project directory. This will create a virtual environment with the dependencies installed - to run commands in the environment first run pipenv shell. By default, pipenv will only install production packages (required for the Django website) - to install packages required to build the tensorflow model, use pipenv install --dev.

About

Maker's Academy final project: Explore machine learning!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published