DOSUG Intro to google prediction api

24
Regression Analysis & Prediction Devon Jones Lead Systems Engineer, Knewton Gabe Hamilton Software Engineering Mgr, Revionics

description

Gabe and Devon present Regression Analysis using Google Prediction API and numpi. These slides are the Google Prediction API portion. For the rest see https://docs.google.com/presentation/d/1Wtivp7IfUOBxr3wWN0lcw97SQiFkWMLBqgQf_bXgJ0c/edit#slide=id.p10 So you want to predict the future? Oh, just some sentiment analysis, spam detection, stock market predictions? In that case the Google Prediction API is for you. Classification problems, Regression problems. This API is a great tool for any software developer and is easily accessible to anyone who is good with spreadsheets.

Transcript of DOSUG Intro to google prediction api

Page 1: DOSUG Intro to google prediction api

Regression Analysis & Prediction

Devon JonesLead Systems Engineer, Knewton

Gabe HamiltonSoftware Engineering Mgr, Revionics

Page 2: DOSUG Intro to google prediction api

For those who work downtown, check out our DOSUG inspired group.

meetup.com/TechConfluence

3rd Wednesday of the month

At lunch: 12:30 - 1:30pm

Tech Confluence

Page 3: DOSUG Intro to google prediction api

The Plan

1. Regression Analysis - Devon

2. Google Prediction API - Gabe

3. Applying Regression - Devon

Page 4: DOSUG Intro to google prediction api

Google Prediction API

{ "label": "awesome", "score": 0.98 },

{ "label": "lame", "score": 0.08 }

Gabe Hamilton

Page 5: DOSUG Intro to google prediction api

What kind of Prediction?

Predict an output value based on some input values.

Things like:

Sentiment Analysis, Spam Detection, Today's temperature, GDP Growth

Page 6: DOSUG Intro to google prediction api
Page 7: DOSUG Intro to google prediction api

How does Google predict things?

Page 8: DOSUG Intro to google prediction api

Through an intensive breeding program Google has managed to distribute Punxsutawney Phils throughout its datacenters across the world. Each Phil is kept in a climate controlled enclosure that mimics the conditions of a perfectly average February 2nd. A full scale digital sundial maps your problem domain onto the shadow matrix of the enclosure allowing each Phil to fully interact with your model. The early spring / long winter emergence probability of each Phil is then sorted and reduced to determine the final result returned by the prediction API.

Well, it's Google

Page 9: DOSUG Intro to google prediction api

No Really, How do they do it?

Short Answer:I have no idea

Long answer:It's a service, they can do whatever works, swap implementations run multiple algorithms

Page 10: DOSUG Intro to google prediction api

Possible Implementations

Regression AnalysisNeural NetworksSupport Vector MachineMonte Carlo SimDecision TreesEvolutionary Algorithms

Basically it is

STATISTICS

Page 11: DOSUG Intro to google prediction api

Types of Prediction you can do

Regression

How do inputs cause an output to vary?

Output is a numeric value: Shopping Cart Size Stock Price

Classification

Deciding which bucket some input belongs in

Buckets are text values: French, Spanish, English

Page 12: DOSUG Intro to google prediction api

What is Classification good for?

Page 13: DOSUG Intro to google prediction api

Classification

● Sentiment analysis● Spam detection● Language categorization● Tagging● Assign priority to bugs● Predict movie ratings● Message routing decisions● <Your brilliant idea here>

Page 14: DOSUG Intro to google prediction api

Hello World page is great

https://developers.google.com/prediction/docs/hello_world

Getting Started

Page 15: DOSUG Intro to google prediction api

So you have a big pile of data

Page 17: DOSUG Intro to google prediction api

CSV Input file aka Training Set

First column is expected values.

2nd through N columns are input values

"French", "Je pense donc j'essuie", "Paris"

Output an input more input

No header columns 250MB max file size

Page 18: DOSUG Intro to google prediction api

1. Create a CSV file of your training data2. Create a new Project in the Prediction API

a. requires entering billing info3. Upload your csv file to Google Storage4. In Prediction API Browser:

a. insert a new training set (the csv file)b. view your trained setc. use trainedmodel.predict to make

predictionsSee the hello world for details of the method calls

4 Steps to Prediction

Page 19: DOSUG Intro to google prediction api

Let's make some predictions...

Page 20: DOSUG Intro to google prediction api

Live demo screenshots: List Models

Page 21: DOSUG Intro to google prediction api

Live demo screens: Analyze Model

Page 22: DOSUG Intro to google prediction api

Live demo: Predict Model Category

Page 23: DOSUG Intro to google prediction api

Live demo: Predict Model Numeric