adventures in azure machine learning from ne bytes

70
Adventures in Azure Machine Learning @deejaygraham

Upload: derek-graham

Post on 15-Apr-2017

166 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Adventures in Azure Machine Learning from NE Bytes

Adventures!in Azure Machine

Learning@deejaygraham

Page 2: Adventures in Azure Machine Learning from NE Bytes

derek graham!principal developer @sage!

special product responsibility for Azure bits

Page 3: Adventures in Azure Machine Learning from NE Bytes
Page 4: Adventures in Azure Machine Learning from NE Bytes
Page 5: Adventures in Azure Machine Learning from NE Bytes

Sorry!!live coding!

live portall-ing

Page 6: Adventures in Azure Machine Learning from NE Bytes

Machine learning is not telling

computers what to do but letting them

learn from examples or past experience

Page 7: Adventures in Azure Machine Learning from NE Bytes
Page 8: Adventures in Azure Machine Learning from NE Bytes

Which means you can…

• Analyse historic or current data • Find patterns and trends • Make predictions about future events

Page 9: Adventures in Azure Machine Learning from NE Bytes
Page 10: Adventures in Azure Machine Learning from NE Bytes
Page 11: Adventures in Azure Machine Learning from NE Bytes
Page 12: Adventures in Azure Machine Learning from NE Bytes
Page 13: Adventures in Azure Machine Learning from NE Bytes

Project Adam

Page 14: Adventures in Azure Machine Learning from NE Bytes
Page 15: Adventures in Azure Machine Learning from NE Bytes
Page 16: Adventures in Azure Machine Learning from NE Bytes
Page 17: Adventures in Azure Machine Learning from NE Bytes
Page 18: Adventures in Azure Machine Learning from NE Bytes

Azure Machine Learning

• A "new" cloud-based service from Microsoft • Integrates with existing Cloud technologies • Use ready-made algorithms • Program custom algorithms tuned to your problem • You can evaluate it for free

Page 19: Adventures in Azure Machine Learning from NE Bytes

http://studio.azureml.net

Page 20: Adventures in Azure Machine Learning from NE Bytes
Page 21: Adventures in Azure Machine Learning from NE Bytes
Page 22: Adventures in Azure Machine Learning from NE Bytes

• Browser based • Drag n Drop • Flowchart-y • Example data sets • Use R or Python • Excellent intro wizard

ML Studio

Page 23: Adventures in Azure Machine Learning from NE Bytes
Page 24: Adventures in Azure Machine Learning from NE Bytes

• Import data • Filter and aggregate data • Create machine learning models • Run experiments • Publish finished model

Provides tools to:

Page 25: Adventures in Azure Machine Learning from NE Bytes
Page 26: Adventures in Azure Machine Learning from NE Bytes

The Learning Process• Define a problem you want to solve • Design a solution • Experiment! !

• Identify your data • Train the model with the data • Evaluate against expected results (speed and

accuracy) • Adapt data or algorithm (or both) • Repeat !

• Save the best model • Publish • Run with live data

Page 27: Adventures in Azure Machine Learning from NE Bytes

Proof!

Page 28: Adventures in Azure Machine Learning from NE Bytes

Imagine…• "Business" Software

• Azure hosted

• PaaS

• Multi-tenanted

Page 29: Adventures in Azure Machine Learning from NE Bytes

Open-ended Workflow• Monday Morning Login

• Friday Reports

• In between?

• Weekends?

• Holidays?

Page 30: Adventures in Azure Machine Learning from NE Bytes

Balancing• User demand

• User experience

• Compute resources

• Cost

Page 31: Adventures in Azure Machine Learning from NE Bytes

Scaling• Instances auto-scale based on the CPU% metric

using Azure’s standard scaling model.

• Azure standard scaling is slow

• Once auto scaler notices we need more capacity, the demand has often disappeared!

• Not a good user experience

Page 32: Adventures in Azure Machine Learning from NE Bytes
Page 33: Adventures in Azure Machine Learning from NE Bytes

Experiment• Customer use is not regular...

• ...but, is it predictable?

Page 34: Adventures in Azure Machine Learning from NE Bytes

Hackathon!• Can we build a better autoscaler?

• Spin-up before high demand

• Tear-down when idle

• Better Cost vs UX

Page 35: Adventures in Azure Machine Learning from NE Bytes
Page 36: Adventures in Azure Machine Learning from NE Bytes

Requirements• What will "we" need on a given date or time?

• Do "we" need to take action now to compensate for what will happen in 20 minutes time?

• Number of instances

• Predicted CPU

Page 37: Adventures in Azure Machine Learning from NE Bytes

Best Predictor of Demand?

• Sessions?

• Instance Memory Use?

• Instance CPU?

Page 38: Adventures in Azure Machine Learning from NE Bytes
Page 39: Adventures in Azure Machine Learning from NE Bytes

Table Storage Diagnostics• Too slow

• Purging

• ML queries all or nothing

• ML Data Reader stops after 4GB

• GB !!!!

• ML times-out after ~3 Hours

Page 40: Adventures in Azure Machine Learning from NE Bytes

CPU

Page 41: Adventures in Azure Machine Learning from NE Bytes

Event Hubs• Application log sink

• Low overhead

• Highly scalable

• Time-based

• Disposable

Page 42: Adventures in Azure Machine Learning from NE Bytes
Page 43: Adventures in Azure Machine Learning from NE Bytes

Neural Net Experiments!

• Feed Forward NN

• Written using R libraries

• Good predictor for 10-20 minute window

• Too inaccurate after that

• Best compromise between precision and speed

• Recurrent NN better at forecasting

• RNN execution time too long

• Need to reduce data to optimal subset

Page 44: Adventures in Azure Machine Learning from NE Bytes

Stream Analytics!

• Real-time data analysis

• Fast

• Sql-like syntax

• Range of inputs and outputs

• Interesting development

Page 45: Adventures in Azure Machine Learning from NE Bytes
Page 46: Adventures in Azure Machine Learning from NE Bytes
Page 47: Adventures in Azure Machine Learning from NE Bytes
Page 48: Adventures in Azure Machine Learning from NE Bytes
Page 49: Adventures in Azure Machine Learning from NE Bytes
Page 50: Adventures in Azure Machine Learning from NE Bytes

Anomalies• Dev Process is painful

• Syntax Errors

• “Test” Import Behaviour

• Starting and Stopping and Starting and Stopping

Page 51: Adventures in Azure Machine Learning from NE Bytes
Page 52: Adventures in Azure Machine Learning from NE Bytes

Compromise

Page 53: Adventures in Azure Machine Learning from NE Bytes

Closing the Loop

Page 54: Adventures in Azure Machine Learning from NE Bytes

Publish…• ReST Web service

• Client Worker Role

• Management Service API

Page 55: Adventures in Azure Machine Learning from NE Bytes

…& Be Damned• Too much data crashes model

• Fine in ML Studio

• 500

• Out of memory?

Page 56: Adventures in Azure Machine Learning from NE Bytes
Page 57: Adventures in Azure Machine Learning from NE Bytes

Finished!

Page 58: Adventures in Azure Machine Learning from NE Bytes
Page 59: Adventures in Azure Machine Learning from NE Bytes

Result!

Page 60: Adventures in Azure Machine Learning from NE Bytes
Page 61: Adventures in Azure Machine Learning from NE Bytes
Page 62: Adventures in Azure Machine Learning from NE Bytes

What we learned

Page 63: Adventures in Azure Machine Learning from NE Bytes

Bugs• We were pushing the environment quite hard

• YMMV

• ML studio has bugs

• Parallel tasks !Parallel

• ML portal missing functionality preventing it being production ready

Page 64: Adventures in Azure Machine Learning from NE Bytes

#DevOps• Sharing models is "public" - Gallery

• No export support

• No support (yet) for model deployment

• Still Drag n Drop

• PowerShell for EventHubs and Stream Analytics

Page 65: Adventures in Azure Machine Learning from NE Bytes

Machine Learning• Parallel R processing library would help

• Finding an appropriate solution often requires a data science specialist

• Solution is only as good as your data

• You may need to compromise on accuracy for speed

• Cost

• Hosting

• Each call to the service

Page 66: Adventures in Azure Machine Learning from NE Bytes

References

http://studio.azureml.net/

Page 67: Adventures in Azure Machine Learning from NE Bytes

E-Book• Microsoft Azure Essentials: Azure Machine

Learning

• Download from: https://mva.microsoft.com/ebooks

Page 68: Adventures in Azure Machine Learning from NE Bytes

Titanic• Jennifer Marsman - https://

blogs.msdn.microsoft.com/jennifer/2016/02/19/using-azure-machine-learning-to-predict-who-will-survive-the-titanic/

• Data Science! https://www.kaggle.com/

• Amy Nicholson @AmyKateNicho https://blogs.technet.microsoft.com/amykatenicho/

Page 69: Adventures in Azure Machine Learning from NE Bytes

#DevOps• https://azure.microsoft.com/en-gb/documentation/articles/event-

hubs-programming-guide/

• https://azure.microsoft.com/en-gb/documentation/articles/service-bus-event-hubs-manage-with-ps/

• https://azure.microsoft.com/en-us/documentation/articles/stream-analytics-dotnet-management-sdk/

• https://azure.microsoft.com/en-us/documentation/articles/stream-analytics-monitor-and-manage-jobs-use-powershell/

Page 70: Adventures in Azure Machine Learning from NE Bytes

Questions ?