This document discusses predictive apps for startups using machine learning. It provides examples of everyday use cases like real estate price prediction and email spam detection. It explains that machine learning works by training a model on data and then using the model to make predictions on new data. The document also discusses how to make machine learning more accessible through cloud platforms and APIs, and how automation tools can help simplify machine learning tasks like model tuning and algorithm selection.
30. The two phases of ML
• TRAIN a model
• PREDICT with a model
30
Machine Learning APIs
31. 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
Machine Learning APIs
32. 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
Machine Learning APIs
33. Example request to BigML API
$ curl https://bigml.io/dev/model?$BIGML_AUTH
-X POST
-H "content-type: application/json"
-d '{"dataset": "dataset/50ca447b3b56356ae0000029"}'
34.
35. • Classification problem
• Features:
• Text of email
• Sender in address book?
• How often do I reply?
• How quickly do I reply?
• Demo
35
Priority detection
36.
37. • 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
Getting started
39. How was it before?
from sklearn import svm
model = svm.SVC(gamma=0.001, C=100.)
from sklearn import datasets
digits = datasets.load_digits()
model.fit(digits.data[:-1], digits.target[:-1])
model.predict(digits.data[-1])
40. How was it before?
from sklearn import svm
model = svm.SVC(gamma=0.001, C=100.)
from sklearn import datasets
digits = datasets.load_digits()
model.fit(digits.data[:-1], digits.target[:-1])
model.predict(digits.data[-1])
WAT?
42. • 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 Source AutoML libraries
43. Scikit
from sklearn import svm
model = svm.SVC(gamma=0.001, C=100.)
from sklearn import datasets
digits = datasets.load_digits()
model.fit(digits.data[:-1], digits.target[:-1])
model.predict(digits.data[-1])
44. Scikit
from sklearn import svm
model = svm.SVC(gamma=0.001, C=100.)
from sklearn import datasets
digits = datasets.load_digits()
model.fit(digits.data[:-1], digits.target[:-1])
model.predict(digits.data[-1])
45. AutoML Scikit
import autosklearn
model = autosklearn.AutoSklearnClassifier()
from sklearn import datasets
digits = datasets.load_digits()
model.fit(digits.data[:-1], digits.target[:-1])
model.predict(digits.data[-1])
46. • 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
Automatization
48. • Classification problem
• Input is an image = pixel values
• Deep Learning! (with Vincent)
48
Image categorization
49. 49
Machine Learning for person detection
pixel1 pixel2 pixel3 person?
102 0 255 Yes
35 41 209 No
… … … …
50. • 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 layers
50
Deep Learning
52. 52
Deep Learning for animal detection
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!
53. 53
Deep Learning for animal detection
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