Top Banner
@louisdorard #ParisDataGeeks
77
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: Pragmatic machine learning for the real world

@louisdorard

#ParisDataGeeks

Page 2: Pragmatic machine learning for the real world
Page 3: Pragmatic machine learning for the real world
Page 4: Pragmatic machine learning for the real world

–Waqar Hasan, Apigee Insights

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

Page 5: Pragmatic machine learning for the real world

–Mike Gualtieri, Principal Analyst at Forrester

“Predictive apps are the next big thing

in app development.”

Page 6: Pragmatic machine learning for the real world

Machine Learning

Page 7: Pragmatic machine learning for the real world

Data

Page 8: Pragmatic machine learning for the real world

BUT

Page 9: Pragmatic machine learning for the real world

–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 10: Pragmatic machine learning for the real world
Page 11: Pragmatic machine learning for the real world

What the @#?~% is ML?

Page 12: Pragmatic machine learning for the real world
Page 13: Pragmatic machine learning for the real world

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

Page 14: Pragmatic machine learning for the real world

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,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,000

4 2001 house 855,000

3 2.5 1472 2005 house

4 3.5 1714 2005 townhouse

2 2 1113 1999 condo

1 769 1999 condo 315,000

Page 15: Pragmatic machine learning for the real world

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,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,000

4 2001 house 855,000

3 2.5 1472 2005 house

4 3.5 1714 2005 townhouse

2 2 1113 1999 condo

1 769 1999 condo 315,000

Page 16: Pragmatic machine learning for the real world
Page 17: Pragmatic machine learning for the real world

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,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,000

4 2001 house 855,000

3 2.5 1472 2005 house

4 3.5 1714 2005 townhouse

2 2 1113 1999 condo

1 769 1999 condo 315,000

Page 18: Pragmatic machine learning for the real world

ML is a set of AI techniques where “intelligence” is built by

referring to examples

Page 19: Pragmatic machine learning for the real world
Page 20: Pragmatic machine learning for the real world
Page 21: Pragmatic machine learning for the real world

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

Page 22: Pragmatic machine learning for the real world

WATCH OUT!

Page 23: Pragmatic machine learning for the real world

• Need examples of inputs AND outputs

• Need enough examples

Page 24: Pragmatic machine learning for the real world

??

Page 25: Pragmatic machine learning for the real world

Prediction APIs

Page 26: Pragmatic machine learning for the real world
Page 27: Pragmatic machine learning for the real world

HTML / CSS / JavaScript

Page 28: Pragmatic machine learning for the real world

HTML / CSS / JavaScript

Page 29: Pragmatic machine learning for the real world

squarespace.com

Page 30: Pragmatic machine learning for the real world
Page 31: Pragmatic machine learning for the real world
Page 32: Pragmatic machine learning for the real world

The two phases of machine learning:

• TRAIN a model

• PREDICT with a model

Page 33: Pragmatic machine learning for the real world

The two methods of prediction APIs:

• TRAIN a model

• PREDICT with a model

Page 34: Pragmatic machine learning for the real world

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

• predicted_output = create_prediction(model, new_input)

Page 35: Pragmatic machine learning for the real world

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 36: Pragmatic machine learning for the real world
Page 37: Pragmatic machine learning for the real world

Beyond predictive modelling

Page 38: Pragmatic machine learning for the real world

Phrase problem as ML task

Engineer features

Prepare data (csv)

Learn model

Make predictions

Deploy model & integrate pred

Evaluate model

Measure impact

PRED

ICTIO

N A

PIS

Page 39: Pragmatic machine learning for the real world

• Deployment to production?

• Maintenance?

• monitor performance

• update with new data

Page 40: Pragmatic machine learning for the real world
Page 41: Pragmatic machine learning for the real world
Page 42: Pragmatic machine learning for the real world
Page 43: Pragmatic machine learning for the real world

• D: Data preparation

• A: Algorithm

• S: Serving

• E: Evaluation

Page 44: Pragmatic machine learning for the real world
Page 45: Pragmatic machine learning for the real world

• Open source

• Spark’s MLlib -> prediction server

• Expose model as (scalable & robust) API

• DASE framework

Page 46: Pragmatic machine learning for the real world

• Send new data/events to event server

• Send prediction queries to engine

Page 47: Pragmatic machine learning for the real world
Page 48: Pragmatic machine learning for the real world
Page 49: Pragmatic machine learning for the real world
Page 50: Pragmatic machine learning for the real world
Page 52: Pragmatic machine learning for the real world

Case study: churn analysis

Page 53: Pragmatic machine learning for the real world

• Who: SaaS company selling monthly subscription

• Question asked: “is this customer going to leave within 1 month?”

• Input: customer

• Output: no-churn (negative) or churn (positive)

• Data collection: history up until 1 month ago

Page 54: Pragmatic machine learning for the real world

Learning -> OK but

How to represent customers? What to do after predicting churn?

Page 55: Pragmatic machine learning for the real world

Customer representation:

• basic info (age, income, etc.)

• usage of service (avg call duration, overcharges, leftover minutes/month, etc.)

• interactions with customer support (how many, topics of questions, satisfaction ratings)

Page 56: Pragmatic machine learning for the real world

Taking action to prevent churn:

• contact customer

• switch to different plan

• fix issues

• give special offer

Page 57: Pragmatic machine learning for the real world

Measuring performance:

• #TP, #FP, #FN

• F-measure?

• ROI

• Compare to baseline

Page 58: Pragmatic machine learning for the real world
Page 59: Pragmatic machine learning for the real world
Page 60: Pragmatic machine learning for the real world
Page 61: Pragmatic machine learning for the real world

Machine Learning Canvas

Page 62: Pragmatic machine learning for the real world
Page 63: Pragmatic machine learning for the real world

BACKGROUND

ENGINE SPECS

INTEGRATION

Page 64: Pragmatic machine learning for the real world

PREDICTIONS OBJECTIVES DATA

BACKGROUND

ENGINE SPECS

INTEGRATION

Page 65: Pragmatic machine learning for the real world

PREDICTIONS OBJECTIVES DATA

BACKGROUND End-user Value prop Sources

ENGINE SPECS ML problem Perf eval Preparation

INTEGRATION Using pred Learning model

Page 66: Pragmatic machine learning for the real world

PREDICTIONS OBJECTIVES DATA

BACKGROUND 1 2 3

ENGINE SPECS 4 5 6

INTEGRATION

Page 67: Pragmatic machine learning for the real world

html

Page 69: Pragmatic machine learning for the real world

End-user Value prop

Sources-> events

ML problem Perf eval Features

Using pred Learning model

DASE

Page 70: Pragmatic machine learning for the real world

Why fill in ML canvas?

• target the right problem for your company

• choose right algorithm, infrastructure, or ML solution

• guide project management

• improve team communication

Page 71: Pragmatic machine learning for the real world

machinelearningcanvas.com

Page 72: Pragmatic machine learning for the real world

Recap

Page 73: Pragmatic machine learning for the real world

• Create value from data with ML!

• Creating and deploying models is easy(er)!

• Good data is essential!

• Use the ML canvas!

• Go to PAPIs Connect!

Page 74: Pragmatic machine learning for the real world

Some real-world insights

• Models that are easier to maintain cost less

• Need to explain predictions?

• One problem may call for another one…

Page 75: Pragmatic machine learning for the real world
Page 76: Pragmatic machine learning for the real world
Page 77: Pragmatic machine learning for the real world

papis.io/connect

Discount code: DATAGEEKS