intro to google prediction api

17
Google Prediction API { "label": "awesome", "score": 0.98 }, { "label": "lame", "score": 0.08 } Gabe Hamilton

Upload: gabehamilton

Post on 05-Dec-2014

3.805 views

Category:

Technology


2 download

DESCRIPTION

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

Page 1: Intro to Google Prediction API

Google Prediction API

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

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

Gabe Hamilton

Page 2: 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 3: Intro to Google Prediction API
Page 4: Intro to Google Prediction API

How does Google predict things?

Page 5: 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 6: 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 7: Intro to Google Prediction API

Possible Implementations

Regression AnalysisNeural NetworksPrimary Comp. Analysis Support Vector MachineMonte Carlo SimDecision TreesEvolutionary Algorithmsetc, etc

But basically it is

STATISTICS

Page 8: Intro to Google Prediction API

Types of Prediction you can doRegression

How do inputs cause an output to vary?

Output is a numeric value: Shopping Cart Size Stock Price GDP

Classification

Deciding which bucket some input belongs in

Buckets are text values: French, Spanish, English

Page 9: Intro to Google Prediction API

What is Classification good for?

Page 10: 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 11: Intro to Google Prediction API

Hello World page is great

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

Getting Started

Page 12: Intro to Google Prediction API

So you have a big pile of data

Page 14: 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 15: 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 info

3. Upload your csv file to Google Storage4. In Prediction API Browser:

a. insert a new training setb. view your trained setc. use trainedmodel.predict to make

predictionsSee the hello world for details of the method calls

4 Steps to Prediction

Page 16: Intro to Google Prediction API

Let's make some predictions...