real time decisions using ml on the google cloud platform
play

Real-Time Decisions Using ML on the Google Cloud Platform - PowerPoint PPT Presentation

Real-Time Decisions Using ML on the Google Cloud Platform Przemysaw Pastuszka & Carlos Garcia QCon London 7th March 2018 How many of you are interested in machine learning? but how many of you are running real-time machine


  1. Real-Time Decisions Using ML on the Google Cloud Platform Przemysław Pastuszka & Carlos Garcia QCon London 7th March 2018

  2. How many of you are interested in machine learning?

  3. but… how many of you are running real-time machine learning in production?

  4. Who is Ocado? Ocado is the world’s We have 645,000 And 49,000 SKUs in largest dedicated active shoppers our webshop online grocery retailer Three highly-automated 263,000 orders a 3 million routing fulfilment centres week ‘picked’ calculations per second

  5. What Ocado Technology does (1) Cloud and AI (2) Automation and robotics (3) Big Data (4) Web and app development (5) IoT

  6. Fraud: An ML journey

  7. But then… what is fraud? Mainly chargebacks • Other types of fraud? • Learn from the actual outcome •

  8. Do I really need to do any ML?

  9. Know your target Do you need ML? • What do you want to predict? • How good are you at predicting that? •

  10. Cost of mistakes False positives and false negatives • How expensive are they? •

  11. Start with heuristics Ask domain experts • Derive rules from expert knowledge • “If more than 80% of order is alcohol, then classify as risky” •

  12. Heuristics are not enough

  13. Motivations for Machine Learning Data-driven

  14. Motivations for Machine Learning Data-driven Fraudsters learn

  15. Motivations for Machine Learning Data-driven Fraudsters learn Customer patterns

  16. Motivations for Machine Learning Data-driven Fraudsters learn Customer patterns Business changes

  17. Challenges Fraud (human) agents • ML is affected by human decisions • Unbalanced classes (fraud / not-fraud) •

  18. What ML model do you choose?

  19. “With great power there must also come… great responsibility” Spider-Man

  20. Criteria Online vs batch predictions

  21. Criteria Online vs batch Explainable predictions predictions

  22. Challenge your explanations “Why should I trust you?” 2016, M. Tulio, S. Singh, C. Guestrin

  23. Criteria Online vs batch Explainable predictions predictions Programming language

  24. Criteria Online vs batch Explainable predictions predictions Programming Cloud vs on-premise language

  25. Our ML choice

  26. Criteria Online vs batch Explainable predictions predictions online preferable Programming Cloud vs on-premise language Python / cloud Java

  27. Machine µService Learning Engine Cloud Model Storage

  28. Interesting alternatives Amazon SageMaker

  29. Interesting alternatives Google Cloud Amazon Machine Learning SageMaker Engine

  30. Problem #1 Not fast enough

  31. Data exploration cycle 03 Act State the hypothesis 02 01 Validate

  32. Validate your hypothesis - fast! Big Query

  33. Problem #2 Data delivered too late

  34. Amazon Web Google Cloud Platform Services Apache Beam µService µService + µService Big Query Kinesis Data Flow µService

  35. List<String> strings = ... strings.stream().collect( Collectors. groupingBy ( word -> word.charAt(0), Collectors. counting ())); PCollection<String> pipeline = ... pipeline .apply(MapElements.via(row -> KV. of (word.charAt(0), word))) .apply(GroupByKey. create ()) .apply(Count. perKey ())

  36. Apache Beam Apache Apache Apache Google Apache Apex Flink Spark Dataflow Gearpump

  37. Problem #3 Missing data

  38. Missing data

  39. Capture every change to the business state

  40. Training

  41. train(C 1 , … C N , O 1 , … O N , Y) = model C 1 , … C N , O 1 , … O N - customer and order features C 1 - Average basket size for the customer O 1 - % of alcoholic items in current order ... Y - Fraud or not fraud

  42. Machine C 1 …, O 1 , … Learning Events Features Engine Model

  43. Apache Airflow Machine C 1 …, O 1 , … SQL Learning Events Features Engine Model

  44. Serving predictions

  45. train(C 1 , … C N , O 1 , … O N , Y) = model model(C 1 , … C N , O 1 , … O N ) = prediction C 1 , … C N , O 1 , … O N - customer and order features C 1 - Average basket size for the customer O 1 - % of alcoholic items in current order ... Y - Fraud or not fraud prediction - Probability of current order being fraudulent

  46. Model O 1 , … O N Machine Learning µService Engine

  47. Apache Airflow SQL Events Features Model Datastore ID: C 1 … C 1 …, O 1 , … ID, O 1 , … Machine Custom Learning µService App Engine

  48. Training Apache Airflow C 1 …, O 1 , … SQL Events Features Serving Model Datastore ID: C 1 … C 1 …, O 1 , … ID, O 1 , … Machine Custom Learning µService App Engine

  49. Architecting for the future

  50. Training Apache Airflow Machine SQL Learning Events Features Engine Serving Model Datastore Custom µService App

  51. Know your target Keep It Simple Choose your model wisely Google Cloud ML Engine for Neural Nets Have data and tools ready BigQuery is king Unified architecture for training and serving predictions

  52. Thank you!

Recommend


More recommend