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.

10 Things Every PHP Developer Should Know About Machine Learning

931 views

Published on

Today’s PHP developers often hear about leveraging machine learning algorithms in order to build more intelligent applications, but many don’t know where to start.

One of the most important aspects of developing smart applications is understanding the underlying machine learning platforms, even if you aren’t the person building them. Whether you are integrating a recommendation system into your app or building a chat bot, this presentation will help you get started in understanding the basics of machine learning.

Published in: Software
  • Be the first to comment

10 Things Every PHP Developer Should Know About Machine Learning

  1. 1. 10 THINGS EVERY PHP DEVELOPER SHOULD KNOW ABOUT MACHINE LEARNING
  2. 2. Fill in the gaps and squash hype around M.L. Build the case for using it now. And provide easy ways to get started. TODAY’S GOALS
  3. 3. Background #1: What it is #2: It’s taking over #3: How it works #4: Different approaches #5: Where it’s used #6: How to get started OUR JOURNEY Code #7: Recommendations #8: Content analysis #9: Computer speech #10: Computer vision
  4. 4. INTRODUCTIONS
  5. 5. ABOUT ME chris.mohritz@10xnation.com ● Lifelong entrepreneur ● Deep technology background (strategy, not developer) ● Using A.I. (machine learning) in business since 2009 ● Opening a startup accelerator in Vegas
  6. 6. HOW I GOT STARTED Apache Mahout (Decision Forest) Behavior prediction Suite of mobile apps Determine most relevant (highest-converting) sales offer to present to each individual user — and the best (highest-converting) time to present it. circa 2009
  7. 7. Will the current user buy “Madden NFL” right now? WHAT IS A DECISION FOREST? is male? is age > 16? is Y app installed? is X app installed? end has used > 30 days? was X function used? was Y function used? no yes no yes no yes no yes end (better ways to do this now) no yes end do it
  8. 8. #1: WHAT IS IT?
  9. 9. “Field of study that gives computers the ability to learn without being explicitly programmed.” ~ Arthur Samuel, 1959 MACHINE LEARNING IS... analyticsvidhya.com/blog/2015/07/difference-machine-learning-statistical-modeling
  10. 10. Training your computer to do stuff, just like you would train a pet. IN OTHER WORDS...
  11. 11. SIMILAR TO HOW WE LEARN Data System Output Model Question Answer Emotions Mindset Algorithm The reference data pattern (decision-making stuff) Process the computer uses to ‘learn’ the model The model is built from historical data Training data Life experience Perspective Algoritm
  12. 12. AT THE END OF THE DAY... It’s all pattern recognition.
  13. 13. #2: WHY SHOULD I CARE?
  14. 14. SOFTWARE IS EATING THE WORLD Everything is becoming code. Software automates, simplifies, and accelerates business.
  15. 15. BUT... Someone needs to write the code/logic.
  16. 16. THE TRADITIONAL WAY Handwritten logic. If / Then / Else
  17. 17. THE PROBLEM Complex situations require complex2 software logic.
  18. 18. THE SOLUTION Trained logic using historical data. Model tripID hasEggs eggsBought milkBought 1 1 6 1 2 0 0 2 3 1 6 1 4 1 8 1 5 0 0 1 6 1 6 1 7 0 0 3 0011001101011101 010110011101 0 11001001101 Stored as a mathematical model. Finds patterns in the data.
  19. 19. WHAT IT LOOKS LIKE console.aws.amazon.com/machinelearning/home?region=us-east-1#/datasources
  20. 20. M.L. IS EATING THE SOFTWARE All applications are becoming “smart” — with unprecedented complexity in logic. Machine learning automates, simplifies, and accelerates software.
  21. 21. ENDLESS OPPORTUNITIES Everything mankind has ever invented — including all software apps — will be reinvented using A.I.
  22. 22. A QUICK NOTE... In the near future, A.I. be writing it’s own code.
  23. 23. #3: HOW DOES IT WORK?
  24. 24. STILL A MURKY LANDSCAPE Artificial Intelligence Machine Understanding (?) Pattern recognition Classification Prediction Can only do one thing Brute-force approach Autonomous decisions Universally applicable Intuition approach Google DeepMind Amazon Machine Learning Natural language processing Computer vision Optimization IBM Watson Classic learning Multi-tiered deep learning neural networks Deep learning neural network Explicit ProgrammingHandwritten Machine Learning logiccomplexity
  25. 25. IT’S ALL CLASSIFICATION via: wjscheirer.com
  26. 26. “Features” Points of differentiation within the data. How would you teach a child to recognize the differences? ● Distance between eyes ● Width of nose ● Shape of cheekbones ● etc. HOW DOES IT CLASSIFY?
  27. 27. “Probability” Each potential answer gets a numeric probability calculated for it. Higher probability means greater confidence. HOW DOES IT MAKE DECISIONS?
  28. 28. ● Supervised learning — Labeled training data ● Unsupervised learning — Unlabeled training data ● Reinforcement learning — Reward-based training TRAINING gym.openai.com
  29. 29. #4: WHAT ARE THE DIFFERENT APPROACHES?
  30. 30. REMEMBER... Data System Output Model Question Answer Emotions Mindset Algorithm The reference data pattern (decision-making stuff) Process the computer uses to ‘learn’ the model The model is built from historical data Training data Life experience Perspective Algoritm
  31. 31. Who wants to be a data scientist? ENDLESS ALGORITHMS docs.microsoft.com/en-us/azure/machine-learning/machine-learning-algorithm-choice machinelearningmastery.com/a-tour-of-machine-learning-algorithms
  32. 32. No “hidden” layers “CLASSIC” LEARNING playground.tensorflow.org
  33. 33. 1-2 “hidden” layers “SHALLOW” LEARNING playground.tensorflow.org
  34. 34. >2 “hidden” layers “DEEP” LEARNING playground.tensorflow.org
  35. 35. (SIMPLE) NEURAL NETWORK Each layer performs a discrete function ≥ 1 input neurons ≥ 1 output neurons ≥ 1 hidden layers Output “fires” if all weighted inputs sum to a set “threshold” Each connection applies a “weighted” influence on the receiving neuron Layers build on each other (iterative) Each input can be a separate “feature” Each neuron takes in multiple inputs Hidden layers can’t directly “see” or act on outside world cs231n.github.io/neural-networks-1
  36. 36. HOW MUCH IS A HOUSE WORTH? Decisions based on combinations. 3 bedrooms 37 years old 1450 ft2 $191,172 Is it “old” or “historic?” Is it “small” or “open floor plan?” $32,108 per bedroom $64,251 per acre Need a lower weight for “old” Apply initial abstractions Set values cs231n.github.io/neural-networks-1
  37. 37. #5: WHERE IS IT USED?
  38. 38. ENDLESS USES ● Classifying DNA sequences ● Economics ● Fraud detection ● Medical diagnosis ● Search engines ● Speech recognition ● Job search ● Spam filtering ● Risk prediction ● Visual product search ● Create art / music ● Industrial design ● Image caption generation ● Facial recognition ● Colorization of b&w images ● Adding sound to silent movies ● Language translation ● Image editing ● Vehicle navigation ● Error detection
  39. 39. IN THE WILD Recommender (pick from list) Classifier (binary) Visual recognition (deep learning)
  40. 40. #6: WHERE SHOULD I START?
  41. 41. ● You don’t need a supercomputer ● You don’t need to write a ton of code ● You don’t need to invest massive amounts of time ● You don’t need a data science degree ● You don’t need to be a math whiz ● You don’t need mountains of data MYTH BUSTING
  42. 42. IT’S EASIER THAN YOU THINK Forget theory, just do it.
  43. 43. ● Amazon Artificial Intelligence ● Google Cloud Machine Learning ● Microsoft Cognitive Services ● IBM Watson * ● DiffBot * - PHP library is 3rd-party SaaS OPTIONS
  44. 44. ● TensorFlow * ● Amazon DSSTNE * ● H2O * ● PredictionIO ● Apache Mahout ● Scikit Learn ● Caffe * OPEN SOURCE OPTIONS ● Microsoft CNTK * ● Torch * ● Theano * ● MXnet * ● Chainer * ● Keras * ● Neon * * ANN / Deep learning
  45. 45. ● archive.ics.uci.edu/ml ● deeplearning.net/datasets ● mldata.org ● grouplens.org/datasets ● cs.toronto.edu/~kriz/cifar.html ● cs.cornell.edu/people/pabo/movie-review-data ● yann.lecun.com/exdb/mnist (handwriting) ● kdnuggets.com/datasets/index.html (long list) ● image-net.org (competition) OPEN SOURCE DATASETS
  46. 46. #7: RECOMMENDATIONS
  47. 47. A CUSTOMER-DRIVEN WORLD Today, consumers control the brand-customer relationship. They choose when and how they interact. Brands need to create attractive experiences that draw consumers in — through highly relevant communications and products.
  48. 48. PRODUCTS
  49. 49. CONTENT
  50. 50. ENDLESS APPLICATIONS ● Visitors who viewed this product also viewed ● Visitors who viewed this product ultimately bought ● You might also like ● Recently viewed ● Trending in category ● Site-wide top sellers ● Customer also bought ● Other customers who bought this product also bought ● Items viewed with items in your cart ● Top sellers from your recent categories on homepage
  51. 51. RECOMMENDATIONS API microsoft.com/cognitive-services/en-us/recommendations-api
  52. 52. Recommendations Build FBT Build Model Application Training Catalog Training Usage HOW IT WORKS Related item recommendations Recommendations API Frequently bought together recommendations
  53. 53. PLAN PLAN LIMITS PRICE Free 10,000 calls / mo Free S1 Standard 100,000 calls / mo $75 / mo (overage at $0.75 / 1000 calls) S2 Standard 1,000,000 calls / mo $500 / mo (overage at $0.75 / 1000 calls) S3 Standard 10,000,000 calls / mo (overage at $0.75 per 1K calls) $2,500 / mo (overage at $0.75 / 1000 calls) S4 Standard 50,000,000 calls/mo $5,000 / mo (overage at $0.75 / 1000 calls) PRICING
  54. 54. Catalog Usage TRAINING DATA
  55. 55. Guide: gigaom.com/2017/02/08/building-a-recommendation-engine-using-microsoft-azure Code: github.com/10xNation/microsoft-recommendation-engine DEMO
  56. 56. #8: CONTENT ANALYSIS
  57. 57. IBM WATSON NATURAL LANGUAGE UNDERSTANDING ibm.com/watson/developercloud/natural-language-understanding.html ● Code: github.com/10xNation/ibm-watson-natural-language-understanding-php ● GUI: natural-language-understanding-demo.mybluemix.net
  58. 58. #9: COMPUTER SPEECH
  59. 59. AMAZON POLLY console.aws.amazon.com/polly/home Code: github.com/10xNation/amazon-polly-demo-php
  60. 60. #10: COMPUTER VISION
  61. 61. GOOGLE CLOUD VISION cloud.google.com/vision Guide: gigaom.com/2017/02/06/harnessing-visual-data-using-google-cloud Code: github.com/GoogleCloudPlatform/php-docs-samples/tree/master/vision/api
  62. 62. CLOSING
  63. 63. Intro blog posts: ● Artificial Intelligence 101 (the big picture) ● Machine Learning 101 (what you’ll actually use) New ‘How to Apply A.I. in Your Business’ blog series: ● Voice-Powered Products w/ Amazon Alexa ● Predictive Social Media w/ IBM Watson(live) ● Image Recognition w/ Google Cloud ● Recommendation Engine w/ Microsoft Azure GO DEEPER
  64. 64. THANK YOU chris.mohritz@10xnation.com

×