10 Things Every PHP Developer Should Know About Machine Learning

Download 10 Things Every PHP Developer Should Know About Machine Learning

Post on 23-Jan-2018

230 views

Category:

Software

0 download

TRANSCRIPT

10 THINGSEVERY PHP DEVELOPER SHOULD KNOW ABOUT MACHINE LEARNINGFill in the gaps and squash hype around M.L.Build the case for using it now.And provide easy ways to get started.TODAYS GOALSBackground#1: What it is#2: Its taking over#3: How it works#4: Different approaches#5: Where its used#6: How to get startedOUR JOURNEYCode#7: Recommendations#8: Content analysis#9: Computer speech#10: Computer visionINTRODUCTIONSABOUT MEchris.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 Vegasmailto:chris.mohritz@10xnation.commailto:chris.mohritz@10xnation.comHOW I GOT STARTEDApache Mahout(Decision Forest)Behavior predictionSuite of mobile appsDetermine most relevant (highest-converting) sales offer to present to each individual user and the best (highest-converting) time to present it.circa 2009Will 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?endhas used > 30 days?was X function used?was Y function used?noyesnoyesnoyesnoyesend(better ways to do this now)noyesenddo it#1: WHAT IS IT?Field of study that gives computers the ability to learn without being explicitly programmed.~ Arthur Samuel, 1959MACHINE LEARNING IS...analyticsvidhya.com/blog/2015/07/difference-machine-learning-statistical-modeling https://en.wikipedia.org/wiki/Arthur_Samuelhttp://www.analyticsvidhya.com/blog/2015/07/difference-machine-learning-statistical-modeling/http://www.analyticsvidhya.com/blog/2015/07/difference-machine-learning-statistical-modeling/Training your computer to do stuff, just like you would train a pet.IN OTHER WORDS...SIMILAR TO HOW WE LEARNData System OutputModelQuestion AnswerEmotionsMindsetAlgorithmThe reference data pattern(decision-making stuff)Process the computer uses to learn the modelThe model is built from historical data Training dataLife experiencePerspectiveAlgoritmAT THE END OF THE DAY...Its all pattern recognition.#2: WHY SHOULD I CARE?SOFTWARE IS EATING THE WORLDEverything is becoming code.Software automates, simplifies, andaccelerates business.http://www.wsj.com/articles/SB10001424053111903480904576512250915629460http://www.wsj.com/articles/SB10001424053111903480904576512250915629460BUT...Someone needs to write the code/logic.THE TRADITIONAL WAYHandwritten logic.If / Then / ElseTHE PROBLEMComplex situations require complex2 software logic.THE SOLUTIONTrained logic using historical data.ModeltripID hasEggs eggsBought milkBought1 1 6 12 0 0 23 1 6 14 1 8 15 0 0 16 1 6 17 0 0 30011001101011101010110011101011001001101Stored as a mathematical model.Finds patterns in the data.WHAT IT LOOKS LIKEconsole.aws.amazon.com/machinelearning/home?region=us-east-1#/datasources https://console.aws.amazon.com/machinelearning/home?region=us-east-1#/datasourceshttps://console.aws.amazon.com/machinelearning/home?region=us-east-1#/datasourcesM.L. IS EATING THE SOFTWAREAll applications are becoming smart with unprecedented complexity in logic.Machine learning automates, simplifies, andaccelerates software.ENDLESS OPPORTUNITIESEverything mankind has ever invented including all software apps will be reinvented using A.I.A QUICK NOTE...In the near future, A.I. be writing its own code.#3: HOW DOES IT WORK?STILL A MURKY LANDSCAPEArtificial IntelligenceMachine Understanding (?)Pattern recognitionClassificationPredictionCan only do one thingBrute-force approachAutonomous decisionsUniversally applicableIntuition approachGoogle DeepMindAmazon Machine LearningNatural language processingComputer visionOptimizationIBM WatsonClassic learningMulti-tiereddeep learning neural networksDeep learning neural networkExplicit ProgrammingHandwrittenMachine Learninglogic complexityhttps://deepmind.com/https://deepmind.com/https://aws.amazon.com/machine-learning/https://aws.amazon.com/machine-learning/http://www.ibm.com/watson/http://www.ibm.com/watson/ITS ALL CLASSIFICATIONvia: wjscheirer.com http://www.wjscheirer.com/FeaturesPoints 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?ProbabilityEach potential answer gets a numeric probability calculated for it.Higher probability means greater confidence.HOW DOES IT MAKE DECISIONS? Supervised learning Labeled training data Unsupervised learning Unlabeled training data Reinforcement learning Reward-based trainingTRAININGgym.openai.com https://gym.openai.com/https://gym.openai.com/#4: WHAT ARE THE DIFFERENT APPROACHES?REMEMBER...Data System OutputModelQuestion AnswerEmotionsMindsetAlgorithmThe reference data pattern(decision-making stuff)Process the computer uses to learn the modelThe model is built from historical data Training dataLife experiencePerspectiveAlgoritmWho wants to be a data scientist?ENDLESS ALGORITHMSdocs.microsoft.com/en-us/azure/machine-learning/machine-learning-algorithm-choice machinelearningmastery.com/a-tour-of-machine-learning-algorithms https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-algorithm-choicehttps://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-algorithm-choicehttp://machinelearningmastery.com/a-tour-of-machine-learning-algorithms/http://machinelearningmastery.com/a-tour-of-machine-learning-algorithms/No hidden layersCLASSIC LEARNINGplayground.tensorflow.org http://playground.tensorflow.org/http://playground.tensorflow.org/1-2 hidden layersSHALLOW LEARNINGplayground.tensorflow.org http://playground.tensorflow.org/http://playground.tensorflow.org/>2 hidden layersDEEP LEARNINGplayground.tensorflow.org http://playground.tensorflow.org/http://playground.tensorflow.org/(SIMPLE) NEURAL NETWORKEach layer performs a discrete function 1 input neurons 1 output neurons 1 hidden layersOutput fires if all weighted inputs sum to a set thresholdEach connection applies a weighted influence on the receiving neuronLayers build on each other(iterative)Each input can be a separate featureEach neuron takes in multiple inputsHidden layers cant directly see or act on outside worldcs231n.github.io/neural-networks-1 http://cs231n.github.io/neural-networks-1/http://cs231n.github.io/neural-networks-1/HOW MUCH IS A HOUSE WORTH?Decisions based on combinations.3 bedrooms37 years old1450 ft2$191,172Is it old or historic?Is it small or open floor plan?$32,108 per bedroom$64,251 per acreNeed a lower weight for oldApply initialabstractionsSet valuescs231n.github.io/neural-networks-1 http://cs231n.github.io/neural-networks-1/http://cs231n.github.io/neural-networks-1/#5: WHERE IS IT USED?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 detectionIN THE WILDRecommender(pick from list)Classifier(binary)Visual recognition(deep learning)#6: WHERE SHOULD I START? You dont need a supercomputer You dont need to write a ton of code You dont need to invest massive amounts of time You dont need a data science degree You dont need to be a math whiz You dont need mountains of dataMYTH BUSTINGITS EASIER THAN YOU THINKForget theory, just do it. Amazon Artificial Intelligence Google Cloud Machine Learning Microsoft Cognitive Services IBM Watson * DiffBot* - PHP library is 3rd-partySaaS OPTIONShttps://aws.amazon.com/amazon-ai/https://aws.amazon.com/amazon-ai/https://cloud.google.com/products/machine-learning/https://cloud.google.com/products/machine-learning/https://www.microsoft.com/cognitive-serviceshttps://www.microsoft.com/cognitive-serviceshttps://www.ibm.com/watson/developercloud/https://www.ibm.com/watson/developercloud/http://www.diffbot.com/http://www.diffbot.com/ TensorFlow * Amazon DSSTNE * H2O * PredictionIO Apache Mahout Scikit Learn Caffe *OPEN SOURCE OPTIONS Microsoft CNTK * Torch * Theano * MXnet * Chainer * Keras * Neon ** ANN / Deep learninghttps://www.tensorflow/https://www.tensorflow/https://github.com/amznlabs/amazon-dsstnehttps://github.com/amznlabs/amazon-dsstnehttp://www.h2o.ai/http://www.h2o.ai/http://prediction.io/http://prediction.io/http://mahout.apache.org/http://mahout.apache.org/http://scikit-learn.org/http://scikit-learn.org/http://caffe.berkeleyvision.org/http://caffe.berkeleyvision.org/https://github.com/Microsoft/CNTKhttps://github.com/Microsoft/CNTKhttp://torch.ch/http://torch.ch/http://deeplearning.net/software/theano/http://deeplearning.net/software/theano/http://mxnet.readthedocs.io/en/latest/http://mxnet.readthedocs.io/en/latest/http://chainer.org/http://chainer.org/http://keras.io/http://keras.io/http://neon.nervanasys.com/docs/latest/index.htmlhttp://neon.nervanasys.com/docs/latest/index.html 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 DATASETShttp://archive.ics.uci.edu/mlhttp://archive.ics.uci.edu/mlhttp://archive.ics.uci.edu/mlhttp://deeplearning.net/datasetshttp://deeplearning.net/datasetshttp://deeplearning.net/datasetshttp://mldata.org/http://mldata.org/http://grouplens.org/datasets/http://grouplens.org/datasets/https://www.cs.toronto.edu/~kriz/cifar.htmlhttps://www.cs.toronto.edu/~kriz/cifar.htmlhttp://www.cs.cornell.edu/people/pabo/movie-review-data/http://www.cs.cornell.edu/people/pabo/movie-review-data/http://yann.lecun.com/exdb/mnist/http://yann.lecun.com/exdb/mnist/http://www.kdnuggets.com/datasets/index.htmlhttp://www.kdnuggets.com/datasets/index.htmlhttp://image-net.org/http://image-net.org/#7: RECOMMENDATIONSA CUSTOMER-DRIVEN WORLDToday, 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.PRODUCTSCONTENTENDLESS 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 homepageRECOMMENDATIONS APImicrosoft.com/cognitive-services/en-us/recommendations-api https://www.microsoft.com/cognitive-services/en-us/recommendations-apihttps://www.microsoft.com/cognitive-services/en-us/recommendations-apiRecommendations BuildFBT BuildModel ApplicationTraining CatalogTraining UsageHOW IT WORKSRelated item recommendationsRecommendations APIFrequently bought together recommendationsPLAN PLAN LIMITS PRICEFree 10,000 calls / mo FreeS1 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)PRICINGCatalogUsageTRAINING DATAhttps://docs.google.com/spreadsheets/d/19m--YY2qVPM1r23KLZ9Q9zP2u4i1OoJdZkCNDbTOoNk/edit?usp=sharinghttps://docs.google.com/spreadsheets/d/19m--YY2qVPM1r23KLZ9Q9zP2u4i1OoJdZkCNDbTOoNk/edit?usp=sharinghttps://docs.google.com/spreadsheets/d/1bpgBwp_KP6aYBFjeRqMxx6kzEkHeRRv7IeCQvQhKVsY/edit?usp=sharinghttps://docs.google.com/spreadsheets/d/1bpgBwp_KP6aYBFjeRqMxx6kzEkHeRRv7IeCQvQhKVsY/edit?usp=sharingGuide: gigaom.com/2017/02/08/building-a-recommendation-engine-using-microsoft-azureCode: github.com/10xNation/microsoft-recommendation-engineDEMOhttps://gigaom.com/2017/02/08/building-a-recommendation-engine-using-microsoft-azure/https://github.com/10xNation/microsoft-recommendation-engine#8: CONTENT ANALYSISIBM WATSON NATURAL LANGUAGE UNDERSTANDINGibm.com/watson/developercloud/natural-language-understanding.html Code: github.com/10xNation/ibm-watson-natural-language-understanding-php GUI: natural-language-understanding-demo.mybluemix.net https://www.ibm.com/watson/developercloud/natural-language-understanding.htmlhttps://www.ibm.com/watson/developercloud/natural-language-understanding.htmlhttps://github.com/10xNation/ibm-watson-natural-language-understanding-phphttps://natural-language-understanding-demo.mybluemix.net/#9: COMPUTER SPEECHAMAZON POLLYconsole.aws.amazon.com/polly/home Code: github.com/10xNation/amazon-polly-demo-phphttps://console.aws.amazon.com/polly/homehttps://console.aws.amazon.com/polly/homehttps://github.com/10xNation/amazon-polly-demo-php#10: COMPUTER VISIONGOOGLE CLOUD VISIONcloud.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 https://cloud.google.com/vision/https://cloud.google.com/vision/https://gigaom.com/2017/02/06/harnessing-visual-data-using-google-cloud/https://github.com/GoogleCloudPlatform/php-docs-samples/tree/master/vision/apiCLOSINGIntro blog posts: Artificial Intelligence 101 (the big picture) Machine Learning 101 (what youll 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 AzureGO DEEPERhttps://10xeffect.com/podcast/what-is-artificial-intelligence/https://10xeffect.com/podcast/what-is-artificial-intelligence/https://10xnation.com/machine-learning/https://10xnation.com/machine-learning/https://gigaom.com/2017/01/30/building-voice-enabled-products-with-amazon-alexa/https://gigaom.com/2017/01/30/building-voice-enabled-products-with-amazon-alexa/https://gigaom.com/2017/02/02/cognitive-customer-engagement-using-ibm-watson/https://social-customer-care.mybluemix.net/https://gigaom.com/2017/02/02/cognitive-customer-engagement-using-ibm-watson/https://gigaom.com/2017/02/06/harnessing-visual-data-using-google-cloud/https://gigaom.com/2017/02/06/harnessing-visual-data-using-google-cloud/##THANK YOUchris.mohritz@10xnation.commailto:chris.mohritz@10xeffect.commailto:chris.mohritz@10xeffect.com