Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@louisdorard
#apidays
PredictiveAPIs
–Mike Gualtieri, Principal Analyst at Forrester
“Predictive apps are
the next big thing
in app development.”
–Waqar Hasan, VISA
“Predictive is the ‘killer app’ for
big data.”
1. Machine Learning
2. Data
BUT
–McKinsey & Co. (2011)
“A significant constraint on
realizing value from big data
will be a shortage of talent,
particularl...
What the @#?~%

is ML?
“Which type of email is this?
— Spam/Ham”


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


I
O
• Need examples of inputs AND outputs
• Need enough examples
??
Predictive APIs
The two phases of machine learning:
• TRAIN a model
• PREDICT with a model
The two methods of predictive APIs:
• TRAIN a model
• PREDICT with a model
The two methods of predictive APIs:
• model = create_model(dataset)
• predicted_output =
create_prediction(model, new_inpu...
from bigml.api import BigML

# create a model
api = BigML()
source =
api.create_source('training_data.csv')
dataset = api....
from bigml.api import BigML

# create a model
api = BigML()
source =
api.create_source('training_data.csv')
dataset = api....
Different needs,
different Predictive APIs
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
“Is this email important?
— Yes/No”
Generic Predictive APIs:
• Google Prediction API
• BigML
• PredicSis
• WolframCloud
• Amazon
AMAZON GOOGLE PREDICSIS BIGML
ACCURACY 0.862 0.743 0.858 0.790
TRAINING
TIME
135s 76s 17s 5s
TEST TIME 188s 369s 5s 1s
lou...
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
“Which project does this document relate to?
— A/B/C”
Text classification APIs:
• uClassify.com
• MonkeyLearn.com
• Cortical.io
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
“Is this customer going to leave next month?
— Yes/No”
“Is this transaction fraudulent?
— Yes/No”
Problem-specific Predictive APIs:
• Churn: ChurnSpotter.io, Framed.io
• Fraud detection: SiftScience.com
• Lead scoring: In...
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
“What is the sentiment of this tweet?
— Positive/Neutral/Negative”
“Is this email spam?
— Yes/No”
Fixed-model Predictive APIs:
• Text: Datumbox.com, Semantria.com
• Vision: Indico, AlchemyAPI.com
• Siri-like: maluuba.com
ABSTRACTION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
CUSTOMIZATION
Algorithmic
Generic
Generic for text
Problem-specific
Fixed-model
Own ML

algorithm?
Own data processing

algorithm?
Data processing
APIfication
MLlib
• “Open source prediction server”
• Based on Spark
• Expose predictive models as (scalable
& robust) APIs
= PAPI+
• Send (new) data
• Send prediction queries
cli = predictionio.EventClient("<my_app_id>")
cli.record_user_action_on_item("view","John","Item")
eng = predictionio.Engi...
Use cases
• Increase e-commerce revenue with recos
• Reduce attrition (“churn”)
• Automate decision making
• Predict real-estate pri...
papis.io/connect
(discount code: APIDAYS)
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Using predictive APIs to create smarter apps
Upcoming SlideShare
Loading in …5
×

Using predictive APIs to create smarter apps

1,018 views

Published on

An introduction to Machine Learning and how to use it in your apps, thanks to Predictive APIs that abstract away part of the complexity. In this talk, I present the different types of Predictive APIs there are and I also show how one can create their own based on open source software.

Talk given at APIdays Mediterranea on 7 May 2015 in Barcelona.

Published in: Technology
  • Be the first to comment

Using predictive APIs to create smarter apps

  1. 1. @louisdorard #apidays
  2. 2. PredictiveAPIs
  3. 3. –Mike Gualtieri, Principal Analyst at Forrester “Predictive apps are the next big thing in app development.”
  4. 4. –Waqar Hasan, VISA “Predictive is the ‘killer app’ for big data.”
  5. 5. 1. Machine Learning 2. Data
  6. 6. BUT
  7. 7. –McKinsey & Co. (2011) “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.”
  8. 8. What the @#?~%
 is ML?
  9. 9. “Which type of email is this? — Spam/Ham” 
 -> Classification
  10. 10. “Which type of email is this? — Spam/Ham” 
 I O
  11. 11. • Need examples of inputs AND outputs • Need enough examples
  12. 12. ??
  13. 13. Predictive APIs
  14. 14. The two phases of machine learning: • TRAIN a model • PREDICT with a model
  15. 15. The two methods of predictive APIs: • TRAIN a model • PREDICT with a model
  16. 16. The two methods of predictive APIs: • model = create_model(dataset) • predicted_output = create_prediction(model, new_input)
  17. 17. from bigml.api import BigML
 # create a model api = BigML() source = api.create_source('training_data.csv') dataset = api.create_dataset(source) model = api.create_model(dataset)
 # make a prediction prediction = api.create_prediction(model, new_input) print "Predicted output value: ",prediction['object']['output'] http://bit.ly/bigml_wakari
  18. 18. from bigml.api import BigML
 # create a model api = BigML() source = api.create_source('training_data.csv') dataset = api.create_dataset(source) model = api.create_model(dataset)
 # make a prediction prediction = api.create_prediction(model, new_input) print "Predicted output value: ",prediction['object']['output'] http://bit.ly/bigml_wakari
  19. 19. Different needs, different Predictive APIs
  20. 20. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  21. 21. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  22. 22. “Is this email important? — Yes/No”
  23. 23. Generic Predictive APIs: • Google Prediction API • BigML • PredicSis • WolframCloud • Amazon
  24. 24. AMAZON GOOGLE PREDICSIS BIGML ACCURACY 0.862 0.743 0.858 0.790 TRAINING TIME 135s 76s 17s 5s TEST TIME 188s 369s 5s 1s louisdorard.com/blog/machine-learning-apis-comparison
  25. 25. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  26. 26. “Which project does this document relate to? — A/B/C”
  27. 27. Text classification APIs: • uClassify.com • MonkeyLearn.com • Cortical.io
  28. 28. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  29. 29. “Is this customer going to leave next month? — Yes/No”
  30. 30. “Is this transaction fraudulent? — Yes/No”
  31. 31. Problem-specific Predictive APIs: • Churn: ChurnSpotter.io, Framed.io • Fraud detection: SiftScience.com • Lead scoring: Infer.com • Personal assistant (Siri): Wit.ai
  32. 32. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  33. 33. “What is the sentiment of this tweet? — Positive/Neutral/Negative”
  34. 34. “Is this email spam? — Yes/No”
  35. 35. Fixed-model Predictive APIs: • Text: Datumbox.com, Semantria.com • Vision: Indico, AlchemyAPI.com • Siri-like: maluuba.com
  36. 36. ABSTRACTION Algorithmic Generic Generic for text Problem-specific Fixed-model
  37. 37. CUSTOMIZATION Algorithmic Generic Generic for text Problem-specific Fixed-model
  38. 38. Own ML
 algorithm?
  39. 39. Own data processing
 algorithm?
  40. 40. Data processing APIfication
  41. 41. MLlib
  42. 42. • “Open source prediction server” • Based on Spark • Expose predictive models as (scalable & robust) APIs
  43. 43. = PAPI+
  44. 44. • Send (new) data • Send prediction queries
  45. 45. 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})
  46. 46. Use cases
  47. 47. • Increase e-commerce revenue with recos • Reduce attrition (“churn”) • Automate decision making • Predict real-estate prices w. open data • Predict crowds (SNCF & La Poste) • …
  48. 48. papis.io/connect (discount code: APIDAYS)

×