Top Banner
@louisdorard #apisberlin
65
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Predictive APIs at APIdays Berlin

@louisdorard

#apisberlin

Page 2: Predictive APIs at APIdays Berlin
Page 3: Predictive APIs at APIdays Berlin
Page 4: Predictive APIs at APIdays Berlin
Page 5: Predictive APIs at APIdays Berlin

PredictiveAPIs

Page 6: Predictive APIs at APIdays Berlin

–Mike Gualtieri, Principal Analyst at Forrester

“Predictive apps are the next big thing

in app development.”

Page 7: Predictive APIs at APIdays Berlin

–Waqar Hasan, VISA

“Predictive is the ‘killer app’ for big data.”

Page 8: Predictive APIs at APIdays Berlin

1. Machine Learning 2. Data

Page 9: Predictive APIs at APIdays Berlin

BUT

Page 10: Predictive APIs at APIdays Berlin

–McKinsey & Co.

“A significant constraint on realizing value from big data will be a shortage of talent, particularly of people with

deep expertise in statistics and machine learning.”

Page 11: Predictive APIs at APIdays Berlin
Page 12: Predictive APIs at APIdays Berlin
Page 13: Predictive APIs at APIdays Berlin
Page 14: Predictive APIs at APIdays Berlin
Page 15: Predictive APIs at APIdays Berlin
Page 16: Predictive APIs at APIdays Berlin

What the @#?~% is ML?

Page 17: Predictive APIs at APIdays Berlin
Page 18: Predictive APIs at APIdays Berlin

“How much is this house worth? — X $” -> Regression

Page 19: Predictive APIs at APIdays Berlin

Bedrooms Bathrooms Surface (foot²) Year built Type Price ($)

3 1 860 1950 house 565,000

3 1 1012 1951 house

2 1.5 968 1976 townhouse 447,000

4 1315 1950 house 648,000

3 2 1599 1964 house

3 2 987 1951 townhouse 790,000

1 1 530 2007 condo 122,000

4 2 1574 1964 house 835,000

4 2001 house 855,000

3 2.5 1472 2005 house

4 3.5 1714 2005 townhouse

Page 20: Predictive APIs at APIdays Berlin

Bedrooms Bathrooms Surface (foot²) Year built Type Price ($)

3 1 860 1950 house 565,000

3 1 1012 1951 house

2 1.5 968 1976 townhouse 447,000

4 1315 1950 house 648,000

3 2 1599 1964 house

3 2 987 1951 townhouse 790,000

1 1 530 2007 condo 122,000

4 2 1574 1964 house 835,000

4 2001 house 855,000

3 2.5 1472 2005 house

4 3.5 1714 2005 townhouse

Page 21: Predictive APIs at APIdays Berlin
Page 22: Predictive APIs at APIdays Berlin
Page 23: Predictive APIs at APIdays Berlin
Page 24: Predictive APIs at APIdays Berlin

“Which type of email is this? — Spam/Ham”-> Classification

Page 25: Predictive APIs at APIdays Berlin

WATCH OUT!

Page 26: Predictive APIs at APIdays Berlin

• Need examples of inputs AND outputs • Need enough examples

Page 27: Predictive APIs at APIdays Berlin

??

Page 28: Predictive APIs at APIdays Berlin

Predictive APIs

Page 29: Predictive APIs at APIdays Berlin

The two phases of machine learning: • TRAIN a model • PREDICT with a model

Page 30: Predictive APIs at APIdays Berlin

The two methods of predictive APIs: • TRAIN a model • PREDICT with a model

Page 31: Predictive APIs at APIdays Berlin

The two methods of predictive APIs: • model = create_model(dataset)

• predicted_output = create_prediction(model, new_input)

Page 32: Predictive APIs at APIdays Berlin

from bigml.api import BigML

# create a modelapi = BigML()source = api.create_source('training_data.csv')dataset = api.create_dataset(source)model = api.create_model(dataset)

# make a predictionprediction = api.create_prediction(model, new_input)print "Predicted output value: ",prediction['object']['output']

http://bit.ly/bigml_wakari

Page 33: Predictive APIs at APIdays Berlin
Page 34: Predictive APIs at APIdays Berlin

Different needs, different Predictive APIs

Page 35: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 36: Predictive APIs at APIdays Berlin

AlgorithmicGeneric

Generic for text Problem-specific

Fixed-model

AB

STRA

CTIO

N

Page 37: Predictive APIs at APIdays Berlin

Algorithmic APIs:• ErsatzLabs -> deep learning • BigML -> decision trees • Wise.io -> random forests

Page 38: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 39: Predictive APIs at APIdays Berlin

Generic Predictive APIs:• BigML • Google Prediction API • Amazon • PredicSis • WolframCloud

Page 40: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for textProblem-specific

Fixed-model

Page 41: Predictive APIs at APIdays Berlin

Text classification APIs:• uClassify.com • MonkeyLearn.com • Cortical.io

Page 42: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 43: Predictive APIs at APIdays Berlin

Problem-specific Predictive APIs:• Churn: Framed.io, ChurnSpotter.io • Fraud detection: SiftScience.com • Lead scoring: Infer.com • Personal assistant (Siri): Wit.ai

Page 44: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 45: Predictive APIs at APIdays Berlin

Fixed-model Predictive APIs:• Text: Datumbox.com, Semantria.com • Vision: Indico, AlchemyAPI.com • Siri-like: maluuba.com

Page 46: Predictive APIs at APIdays Berlin

AB

STRA

CTIO

N

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 47: Predictive APIs at APIdays Berlin

CU

STOM

IZATION

Algorithmic Generic

Generic for text Problem-specific

Fixed-model

Page 48: Predictive APIs at APIdays Berlin

Custom MLalgorithm?

Page 49: Predictive APIs at APIdays Berlin

Custom data processingalgorithm?

Page 50: Predictive APIs at APIdays Berlin

Data processing APIfication

Page 51: Predictive APIs at APIdays Berlin
Page 52: Predictive APIs at APIdays Berlin
Page 53: Predictive APIs at APIdays Berlin
Page 54: Predictive APIs at APIdays Berlin

MLlib

Page 55: Predictive APIs at APIdays Berlin
Page 56: Predictive APIs at APIdays Berlin
Page 57: Predictive APIs at APIdays Berlin

• “Open source prediction server” • Based on Spark • Expose predictive models as (scalable

& robust) APIs

Page 58: Predictive APIs at APIdays Berlin

= PAPI+

Page 59: Predictive APIs at APIdays Berlin

• Send (new) data • Send prediction queries

Page 60: Predictive APIs at APIdays Berlin

cli = predictionio.EventClient("<my_app_id>") cli.record_user_action_on_item("view","John","Item") eng = predictionio.EngineClient("<my_engine_url>") rec = eng.send_query({"uid":"John","n":5})

Page 61: Predictive APIs at APIdays Berlin
Page 62: Predictive APIs at APIdays Berlin

Use cases

Page 63: Predictive APIs at APIdays Berlin

• Increase e-commerce revenue with recos • Reduce attrition (“churn”) • Automate decision making • Predict real-estate prices w. open data • Predict crowds (SNCF & La Poste) • …

Page 64: Predictive APIs at APIdays Berlin
Page 65: Predictive APIs at APIdays Berlin

papis.io/connect

(discount code: APIDAYS)