deploying predic ve models in the cloud using yhat
play

Deploying Predic/ve Models in the Cloud using Yhat Luke - PowerPoint PPT Presentation

Deploying Predic/ve Models in the Cloud using Yhat Luke Sheneman NKN Technology and Data Services Manager NKN Tech Talk December 17, 2015


  1. Deploying ¡Predic/ve ¡Models ¡ ¡ in ¡the ¡Cloud ¡using ¡Yhat ¡ Luke ¡Sheneman ¡ NKN ¡Technology ¡and ¡Data ¡Services ¡Manager ¡ ¡ NKN ¡Tech ¡Talk ¡ December ¡17, ¡2015 ¡ ¡

  2. Machine ¡Learning: ¡ Training ¡Sta/s/cal ¡Predic/ve ¡Models ¡in ¡R ¡ topepo.github.io/caret/ ¡ • caret ¡( Classifica(on ¡And ¡Regression ¡Training ) ¡ is ¡a ¡powerful ¡R ¡package ¡for ¡machine ¡learning ¡ – Data ¡SpliMng ¡ – Training ¡ – Cross ¡Valida/on ¡ – Predic/on ¡ ¡

  3. Model ¡Training ¡and ¡Predic/on ¡

  4. Real ¡Example ¡– ¡Wearable ¡Sensor ¡Data ¡ ¡github.com/sheneman/machinelearning ¡ • Use ¡ quan(ta(ve ¡raw ¡data ¡from ¡wearable ¡ sensors ¡to ¡ qualita(vely ¡classify ¡human ¡mo/on. ¡ Velloso, ¡E.; ¡Bulling, ¡A.; ¡Gellersen, ¡H.; ¡Ugulino, ¡W.; ¡Fuks, ¡H. ¡Qualita/ve ¡Ac/vity ¡Recogni/on ¡of ¡Weight ¡Li]ing ¡Exercises. ¡ – Proceedings ¡of ¡4th ¡Interna/onal ¡Conference ¡in ¡Coopera/on ¡with ¡SIGCHI ¡(Augmented ¡Human ¡'13) ¡. ¡Stubgart, ¡Germany: ¡ACM ¡ SIGCHI, ¡2013. ¡hbp://groupware.les.inf.puc-­‑rio.br/har ¡ • 160 ¡variables, ¡20K ¡observa/ons ¡ – Predictors: ¡ ¡ ¡ Subject ¡ID, ¡roll, ¡pitch, ¡yaw, ¡accelera/on, ¡/me ¡ ¡ • mean, ¡stdev, ¡kurtosis, ¡skewness ¡ – – Outcomes/objec/ves: ¡ Classifica/on: ¡ ¡ ¡A,B,C,D,E ¡ •

  5. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Training ¡the ¡Models ¡ ¡ ¡ Method ¡#1: ¡ ¡ ¡Recursive ¡Par99oning ¡and ¡Regression ¡Trees ¡(RPART): ¡ ¡ control ¡<-­‑ ¡trainControl(method="cv", ¡number=5) ¡ modelfit ¡<-­‑ ¡ train (classe ¡~ ¡., ¡data=new_training_data, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡trControl=control, ¡method="rpart") ¡ ¡ ¡ Method ¡#2: ¡ ¡Bootstrap ¡Aggrega9on ¡(BAGGING): ¡ ¡ control ¡<-­‑ ¡trainControl(method="cv", ¡number=5, ¡verboseIter=TRUE) ¡ modelfit ¡<-­‑ ¡ train (classe ¡~ ¡., ¡data=new_training_data, ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡trControl=control, ¡method="treebag") ¡

  6. Predic/on ¡from ¡Trained ¡Models ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡predic/ons ¡<-­‑ ¡ predict (modelfit, ¡new_training_data) ¡ ¡ ¡

  7. Results ¡ RPART ¡Method ¡ BAGGING ¡Method ¡ Aggrega/ng ¡results ¡ Aggrega/ng ¡results ¡ Selec/ng ¡tuning ¡parameters ¡ FiMng ¡final ¡model ¡on ¡full ¡training ¡set ¡ FiMng ¡cp ¡= ¡0.0395 ¡on ¡full ¡training ¡set ¡ Confusion ¡Matrix ¡and ¡Sta/s/cs ¡ Confusion ¡Matrix ¡and ¡Sta/s/cs ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Reference ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Reference ¡ Predic/on ¡ ¡ ¡ ¡A ¡ ¡ ¡ ¡B ¡ ¡ ¡ ¡C ¡ ¡ ¡ ¡D ¡ ¡ ¡ ¡E ¡ Predic/on ¡ ¡ ¡ ¡A ¡ ¡ ¡ ¡B ¡ ¡ ¡ ¡C ¡ ¡ ¡ ¡D ¡ ¡ ¡ ¡E ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡A ¡5080 ¡1581 ¡1587 ¡1449 ¡ ¡524 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡A ¡5580 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡B ¡ ¡ ¡81 ¡1286 ¡ ¡108 ¡ ¡568 ¡ ¡486 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡B ¡ ¡ ¡ ¡0 ¡3797 ¡ ¡ ¡ ¡ 1 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡C ¡ ¡405 ¡ ¡930 ¡1727 ¡1199 ¡ ¡966 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡C ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡3421 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡D ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡D ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡3216 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡E ¡ ¡ ¡14 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡1631 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡E ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡ ¡ ¡ ¡0 ¡3607 ¡ Overall ¡Sta/s/cs ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Overall ¡Sta/s/cs ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Accuracy ¡: ¡0.4956 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡95% ¡CI ¡: ¡(0.4885, ¡0.5026) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Accuracy ¡: ¡0.9999 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡No ¡Informa/on ¡Rate ¡: ¡0.2844 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡P-­‑Value ¡[Acc ¡> ¡NIR] ¡: ¡< ¡2.2e-­‑16 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡95% ¡CI ¡: ¡(0.9997, ¡1) ¡ ¡ ¡ ¡ ¡No ¡Informa/on ¡Rate ¡: ¡0.2844 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡P-­‑Value ¡[Acc ¡> ¡NIR] ¡: ¡< ¡2.2e-­‑16 ¡ ¡

  8. Python ¡IDE ¡for ¡Data ¡Science ¡ Publish ¡Predic/ve ¡Models ¡ Distributed ¡Compu/ng ¡Foo ¡

  9. WHAT ¡IS ¡SCIENCEOPS? ¡ ¡ ScienceOps ¡is ¡a ¡plasorm ¡for ¡deploying, ¡ managing ¡and ¡scaling ¡predic/ve ¡models ¡and ¡ advanced ¡decision-­‑making ¡algorithms ¡into ¡ produc/on. ¡The ¡plasorm ¡is ¡designed ¡for ¡ produc/on-­‑level ¡seMngs ¡and ¡u/lizes ¡a ¡ distributed ¡architecture ¡to ¡allocate ¡and ¡ op/mize ¡requests ¡to ¡models ¡across ¡the ¡cluster. ¡

  10. yhatr ¡ • hbps://github.com/yhat/yhatr ¡ ¡ – implictly ¡requires ¡ rjson ¡package ¡ • model.require() ¡ – specify ¡library ¡dependencies ¡ • model.tranform() ¡ – transform ¡input ¡data ¡ • model.predict() ¡ – call ¡the ¡predic/on ¡func/on ¡

  11. Hello ¡World ¡in ¡ ¡ R ¡ Python ¡ * ¡In ¡R, ¡all ¡input ¡and ¡output ¡to ¡model.predict() ¡must ¡be ¡a ¡ Data ¡Frame ¡ type ¡

  12. Examples: ¡ • Hello ¡World! ¡ • Custom ¡NKN ¡Example ¡ • Beer ¡Selector ¡

  13. Applica/ons ¡ • MaaS ¡– ¡ Model ¡as ¡a ¡Service ¡paradigm ¡ • REST ¡API ¡ – Build ¡applica/ons ¡against ¡standard ¡API ¡ – Simulate ¡3 rd ¡party ¡app ¡development ¡from ¡your ¡model ¡ – Deploy ¡to ¡one ¡or ¡millions ¡of ¡users ¡ – A ¡Form ¡of ¡Data/Model ¡Interoperability: ¡ • JSON ¡+ ¡REST ¡Web ¡Service ¡ • Build ¡interes/ng ¡composite ¡apps ¡using ¡predic/ons ¡from ¡mul/ple ¡ models! ¡ • Auto ¡re-­‑deploy ¡model ¡as ¡addi/onal ¡data ¡streams ¡in: ¡ – Weather, ¡Climate, ¡Precision ¡Agriculture, ¡Hazard ¡Predic/on, ¡ Climate ¡Hot ¡Spots, ¡Social ¡Media ¡ ¡ • Horizontally ¡Scalable ¡on ¡Cloud ¡Infrastructure ¡

  14. “Even ¡if ¡NKN ¡does ¡not ¡use ¡Yhat ¡specifically, ¡this ¡ kind ¡of ¡idea ¡is ¡a ¡wonderful ¡example ¡of ¡the ¡ NKN ¡ Data ¡Observatory ¡concept ¡in ¡ac(on. ¡ ¡ ¡Namely, ¡ Yhat ¡can ¡leverage ¡exis(ng ¡data ¡to ¡do ¡ new ¡ science ¡via ¡ data/model ¡interoperability . ¡ ¡ ¡ ¡ ¡ Exposing ¡standard ¡web ¡service ¡APIs ¡are ¡the ¡key.” ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡-­‑-­‑ ¡Famous ¡Olde ¡Quote ¡

  15. Thank ¡You! ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend