pragmatic machine learning for the real world
TRANSCRIPT
![Page 1: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/1.jpg)
@louisdorard
#ParisDataGeeks
![Page 2: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/2.jpg)
![Page 3: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/3.jpg)
![Page 4: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/4.jpg)
–Waqar Hasan, Apigee Insights
“Predictive is the ‘killer app’ for big data.”
![Page 5: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/5.jpg)
–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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/6.jpg)
Machine Learning
![Page 7: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/7.jpg)
Data
![Page 8: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/8.jpg)
BUT
![Page 9: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/9.jpg)
–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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/10.jpg)
![Page 11: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/11.jpg)
What the @#?~% is ML?
![Page 12: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/12.jpg)
![Page 13: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/13.jpg)
“How much is this house worth? — X $” -> Regression
![Page 14: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/16.jpg)
![Page 17: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/17.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/18.jpg)
ML is a set of AI techniques where “intelligence” is built by
referring to examples
![Page 19: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/19.jpg)
![Page 20: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/20.jpg)
![Page 21: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/21.jpg)
“Which type of email is this? — Spam/Ham”-> Classification
![Page 22: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/22.jpg)
WATCH OUT!
![Page 23: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/23.jpg)
• Need examples of inputs AND outputs
• Need enough examples
![Page 24: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/24.jpg)
??
![Page 25: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/25.jpg)
Prediction APIs
![Page 26: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/26.jpg)
![Page 27: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/27.jpg)
HTML / CSS / JavaScript
![Page 28: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/28.jpg)
HTML / CSS / JavaScript
![Page 30: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/30.jpg)
![Page 31: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/31.jpg)
![Page 32: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/32.jpg)
The two phases of machine learning:
• TRAIN a model
• PREDICT with a model
![Page 33: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/33.jpg)
The two methods of prediction APIs:
• TRAIN a model
• PREDICT with a model
![Page 34: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/34.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/35.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/36.jpg)
![Page 37: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/37.jpg)
Beyond predictive modelling
![Page 38: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/38.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/39.jpg)
• Deployment to production?
• Maintenance?
• monitor performance
• update with new data
![Page 40: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/40.jpg)
![Page 41: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/41.jpg)
![Page 42: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/42.jpg)
![Page 43: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/43.jpg)
• D: Data preparation
• A: Algorithm
• S: Serving
• E: Evaluation
![Page 44: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/44.jpg)
![Page 45: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/45.jpg)
• Open source
• Spark’s MLlib -> prediction server
• Expose model as (scalable & robust) API
• DASE framework
![Page 46: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/46.jpg)
• Send new data/events to event server
• Send prediction queries to engine
![Page 47: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/47.jpg)
![Page 48: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/48.jpg)
![Page 49: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/49.jpg)
![Page 50: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/50.jpg)
![Page 51: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/51.jpg)
PredictionIO vs Azure ML on KDnuggets
![Page 52: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/52.jpg)
Case study: churn analysis
![Page 53: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/53.jpg)
• 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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/54.jpg)
Learning -> OK but
How to represent customers? What to do after predicting churn?
![Page 55: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/55.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/56.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/57.jpg)
Measuring performance:
• #TP, #FP, #FN
• F-measure?
• ROI
• Compare to baseline
![Page 58: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/58.jpg)
![Page 59: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/59.jpg)
![Page 60: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/60.jpg)
![Page 61: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/61.jpg)
Machine Learning Canvas
![Page 62: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/62.jpg)
![Page 63: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/63.jpg)
BACKGROUND
ENGINE SPECS
INTEGRATION
![Page 64: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/64.jpg)
PREDICTIONS OBJECTIVES DATA
BACKGROUND
ENGINE SPECS
INTEGRATION
![Page 65: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/65.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/66.jpg)
PREDICTIONS OBJECTIVES DATA
BACKGROUND 1 2 3
ENGINE SPECS 4 5 6
INTEGRATION
![Page 67: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/67.jpg)
html
![Page 69: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/69.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/70.jpg)
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 72: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/72.jpg)
Recap
![Page 73: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/73.jpg)
• 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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/74.jpg)
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](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/75.jpg)
![Page 76: Pragmatic machine learning for the real world](https://reader036.vdocuments.mx/reader036/viewer/2022081513/55a59f1c1a28abae018b4668/html5/thumbnails/76.jpg)