predictive apps for startups

57
Predictive Apps for Startups @louisdorard #MLVLC - 11 March 2016

Upload: louis-dorard

Post on 22-Mar-2017

410 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Predictive apps for startups

Predictive Apps for Startups

@louisdorard #MLVLC - 11 March 2016

Page 2: Predictive apps for startups

AI is everywhere

Page 3: Predictive apps for startups
Page 4: Predictive apps for startups
Page 5: Predictive apps for startups
Page 6: Predictive apps for startups
Page 7: Predictive apps for startups
Page 8: Predictive apps for startups
Page 9: Predictive apps for startups
Page 11: Predictive apps for startups

@louisdorard

Page 12: Predictive apps for startups

How does it work?

Page 13: Predictive apps for startups

Data + Machine Learning

Page 14: Predictive apps for startups
Page 15: Predictive apps for startups

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

3 1 860 1950 house 565,0003 1 1012 1951 house2 1.5 968 1976 townhouse 447,0004 1315 1950 house 648,0003 2 1599 1964 house3 2 987 1951 townhouse 790,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,0004 2001 house 855,0003 2.5 1472 2005 house4 3.5 1714 2005 townhouse2 2 1113 1999 condo1 769 1999 condo 315,000

Page 16: Predictive apps for startups

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

3 1 860 1950 house 565,0003 1 1012 1951 house2 1.5 968 1976 townhouse 447,0004 1315 1950 house 648,0003 2 1599 1964 house3 2 987 1951 townhouse 790,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,0004 2001 house 855,0003 2.5 1472 2005 house4 3.5 1714 2005 townhouse2 2 1113 1999 condo1 769 1999 condo 315,000

Page 17: Predictive apps for startups
Page 18: Predictive apps for startups

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

3 1 860 1950 house 565,0003 1 1012 1951 house2 1.5 968 1976 townhouse 447,0004 1315 1950 house 648,0003 2 1599 1964 house3 2 987 1951 townhouse 790,0001 1 530 2007 condo 122,0004 2 1574 1964 house 835,0004 2001 house 855,0003 2.5 1472 2005 house4 3.5 1714 2005 townhouse2 2 1113 1999 condo1 769 1999 condo 315,000

Page 19: Predictive apps for startups

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

examples

Page 20: Predictive apps for startups
Page 21: Predictive apps for startups

“Weak AI” vs. “Strong AI”

Page 22: Predictive apps for startups

22

Ever yday use cases

• Real-estate

• Spam

• Priority inbox

• Crowd prediction

property price

email spam indicator

email importance indicator

location & context #people

Zillow

Gmail

Gmail

Tranquilien

Page 23: Predictive apps for startups

Making Machine Learning accessible with cloud platforms

Page 24: Predictive apps for startups
Page 25: Predictive apps for startups

HTML / CSS / JavaScript

Page 26: Predictive apps for startups

HTML / CSS / JavaScript

Page 27: Predictive apps for startups

squarespace.com

Page 28: Predictive apps for startups
Page 29: Predictive apps for startups
Page 30: Predictive apps for startups

The two phases of ML

• TRAIN a model

• PREDICT with a model

30

M achine Learning APIs

Page 31: Predictive apps for startups

The two methods of ML Application Programming Interfaces (here in Python)

• model = create_model(‘training.csv’)

• predicted_output, confidence = create_prediction(model, new_input)

31

M achine Learning APIs

Page 32: Predictive apps for startups

The two methods of ML Application Programming Interfaces (here in Python)

• model = create_model(‘training.csv’)

• predicted_output, confidence = create_prediction(model, new_input)

32

M achine Learning APIs

Page 33: Predictive apps for startups

Example request to BigML API

$ curl https://bigml.io/dev/model?$BIGML_AUTH \ -X POST \ -H "content-type: application/json" \ -d '{"dataset": "dataset/50ca447b3b56356ae0000029"}'

Page 34: Predictive apps for startups
Page 35: Predictive apps for startups

• Classification problem

• Features:

• Text of email

• Sender in address book?

• How often do I reply?

• How quickly do I reply?

• Demo35

Prior it y detec t ion

Page 36: Predictive apps for startups
Page 37: Predictive apps for startups

• VM with Jupyter notebooks (Python & Bash)

• API wrappers preinstalled: BigML & Google Pred

• Notebook for easy setup of credentials

• Scikit-learn and Pandas preinstalled

• Open source VM provisioning script & notebooks

• Search public Snaps on terminal.com: “machine learning”37

G etting star ted

Page 38: Predictive apps for startups

Making Machine Learning easier

Page 39: Predictive apps for startups

How was i t before?

from sklearn import svmmodel = svm.SVC(gamma=0.001, C=100.)

from sklearn import datasetsdigits = datasets.load_digits() model.fit(digits.data[:-1], digits.target[:-1])

model.predict(digits.data[-1])

Page 40: Predictive apps for startups

How was i t before?

from sklearn import svmmodel = svm.SVC(gamma=0.001, C=100.)

from sklearn import datasetsdigits = datasets.load_digits() model.fit(digits.data[:-1], digits.target[:-1])

model.predict(digits.data[-1])

WAT?

Page 41: Predictive apps for startups

http://oscar.sensout.com

Page 42: Predictive apps for startups

• Spearmint: “Bayesian optimization” for tuning parameters → Whetlab → Twitter

• Auto-sklearn: “automated machine learning toolkit and drop-in replacement for a scikit-learn estimator”

42

Open S ource AutoML l ibrar ies

Page 43: Predictive apps for startups

S cik it

from sklearn import svmmodel = svm.SVC(gamma=0.001, C=100.)

from sklearn import datasetsdigits = datasets.load_digits() model.fit(digits.data[:-1], digits.target[:-1])

model.predict(digits.data[-1])

Page 44: Predictive apps for startups

S cik it

from sklearn import svmmodel = svm.SVC(gamma=0.001, C=100.)

from sklearn import datasetsdigits = datasets.load_digits() model.fit(digits.data[:-1], digits.target[:-1])

model.predict(digits.data[-1])

Page 45: Predictive apps for startups

AutoML S cik it

import autosklearnmodel = autosklearn.AutoSklearnClassifier()

from sklearn import datasetsdigits = datasets.load_digits() model.fit(digits.data[:-1], digits.target[:-1])

model.predict(digits.data[-1])

Page 46: Predictive apps for startups

• Algorithm selection… AutoML

• Scaling… Azure ML or Yhat (Greg at PAPIs Connect)

• “Automating ML workflows: a report from the trenches” — Jose A. Ortega Ruiz

46

Automatizat ion

Page 47: Predictive apps for startups

Making Deep Learning accessible

Page 48: Predictive apps for startups

• Classification problem

• Input is an image = pixel values

• Deep Learning! (with Vincent)

48

I mage categorizat ion

Page 49: Predictive apps for startups

49

M achine Learning for person detec t ion

pixel1 pixel2 pixel3 person?

102 0 255 Yes35 41 209 No… … … …

Page 50: Predictive apps for startups

• Neural network:

• Layers

• Neurons of one layer connected to neurons of next layer

• Each neuron receives signals from previous layer and sends new signal to next layer

• New signal based on linear combination of signals received

• “Deep” -> more than 3 layers50

Deep Learning

Page 51: Predictive apps for startups

51

Deep Learning for animal detec t ion

Page 52: Predictive apps for startups

52

Deep Learning for animal detec t ion

pixel1

pixel2

pixel3

cat

dog

1st layer value=(102, 0, 255)

Last layer value=(0.1, 0.7, 0.4)

Output value=(0.8, 0.3) => there’s

probably a cat!

Page 53: Predictive apps for startups

53

Deep Learning for animal detec t ion

pixel1

pixel2

pixel3

cat

dog

1st layer value=(4, 166, 23)

Last layer value=(0.1, 0.7, 0.4)

Output value=(0.1, 0.2) => probably no

animal here

Page 54: Predictive apps for startups

pixel1

pixel2

pixel3

cat

dog

1st layer value=(102, 0, 255)

Output value=(0.8, 0.3) => there’s

probably a cat!

Last layer value=(0.1, 0.7, 0.4)

Page 55: Predictive apps for startups

55

M achine Learning for person detec t ion

pixel1 pixel2 pixel3 person?

102 0 255 Yes35 41 209 No… … … …

• Use network for animal detection until last layer

• Replace images with “smart” representation given by last layer

neuron1 neuron2 neuron3 person?

0.1 0.2 0.5 Yes0.8 0.3 0.8 No… … … …

Page 56: Predictive apps for startups
Page 57: Predictive apps for startups

• Artificial Intelligence for Business and Society

• Next Monday & Tuesday

• papis.io/connect

• Discount for 24 hours only!

57

PAPIs Connec t