Azure Machine Learning from basic to integration with custom application Davide Mauri Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek About Me Microsoft SQL Server MVP Works with SQL Server from 6.5, on BI from 2003 Specialized in Data Solution Architecture, Database Design, Performance Tuning, High-Performance Data Warehousing, BI, Big Data President of UGISS (Italian SQL Server UG) Regular Speaker @ SQL Server events Consulting & Training, Mentor @ SolidQ E-mail: dmauri@solidq.com Twitter: @mauridb Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Agenda • Machine Learning, what’s that? • Supervised & Unsupervised methods • Tools & Languages • Experimenting On-Premises • IPython & R • SQL Server 2016 and R • Azure Machine Learning • AzureML Studio • Jupyter Notebooks • Integrating AzureML into custom applications
Machine Learning What’s that? Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Machine Learning • Algorithms that learn from data • Nothing really new from a scientific point of view • "Field of study that gives computers the ability to learn without being explicitly programmed“ - 1959, Arthur Samuel • Requires *a lot* of compute power (even for not-so-big-data) • Azure, here we come!  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Machine Learning • Very useful for • Identify unknown and complex pattern • Identify hidden correlations • Automatically classify data • Predict future trend and/or values basing on past knowledge Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Machine Learning • Thanks to the cloud it’s now possible to integrate ML Algorithms into Line-Of-Business applications • Choose the algorithm • Train it • Expose as a RESTful Web Service • Call it from you App • You’re Happy  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Machine Learning • Two main categories (but sometimes are even divided in up to five categories!) • Supervised • Unsupervised • Supervised: humans (usually) teach to algorithms what is the expected result • Unsupervised: algorithms tries to autonomously identify patterns and rules in given dataset Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Languages • Most common languages used for machine learning • R • Python • Less common but on the rise • Julia • Scala • Go • Rust Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Tools - Python • Python Packages • Scikit-Learn • SciPy, NumPy, Pandas, Matplotlib, Seaborn • Jupyter (was: IPython) • Anaconda • Microsoft Data Science Virtual Machine • Pytools for Visual Studio Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Tools - R • R • Microsoft Open R Portal • Microsoft R Open (MRO) • RStudio • R Tools for Visual Studio • Microsoft Data Science Virtual Machine • Anaconda • https://www.continuum.io/conda-for-r Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Datasets • To learn ML, sample and well-known datasets are needed • Here some places where nice Datasets can be found • http://archive.ics.uci.edu/ml/datasets.html • http://www.kdnuggets.com/datasets/index.html • http://homepages.inf.ed.ac.uk/rbf/IAPR/researchers/MLPAGES/mldat.htm • https://en.wikipedia.org/wiki/Data_set#Classic_datasets • https://mran.revolutionanalytics.com/documents/data/ Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
IRIS Dataset • 150 instances of Iris Flowers • 3 classes: Virginica, Versicolor, Setosa • 4 features: Sepal Width & Length, Petal Width & Length • One of the most used for educational purposes • Simple, but…. • Un class is linearly separable • Other two classes are NOT linearly separable • Available at UC Irvine Machine Learning Repository • http://archive.ics.uci.edu/ml/datasets/Iris Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
IRIS Dataset http://www.anselm.edu/homepage/jpitocch/genbi101/diversity3Plants.html Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments On-Premises
SQL Server 2016 and R Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments with R and SQL Server 2016
Azure ML Studio On the Cloud! Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
AzureML Studio • www.azureml.com • Azure ML Studio • Web application (“Workspace”) for developing ML solutions • Part of the “Cortana Analytics Intelligence Suite” • Development Process • Experiment -> Score -> Evaluate • Publish Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
AzureML Studio • “Democratize Machine Learning” • Free Tier Available • 10 GB Storage Space • 1h max experiment duration • Staging Web API • Standard Tier • Costs per “Seat”, Studio and API Usage • https://azure.microsoft.com/en-us/pricing/details/machine-learning/ Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
AzureML Studio • Fully Interactive Environment • Fully Integrated with Azure Ecosystem, but not only that  • Very easy to use external data sources • Support Jupyter/IPython Notebooks! • Even more Interative!  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments On-Premises
AzureML Web Services • Once the experiment has been created, tested and validated • NOTE! AzureML Web Services *does not* support CORS right now • So it’s ok to call from a server-side script • If you want to call it directly from Javascript you need to go through Azure Management API • And configure the Policy to allow CORS Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
AzureML Web Services • Can be created also on-premises with R and Python Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments With Web Services
What’s more • In addition to the “usual” Machine Learning objects Azure offers specialized API and the “Cognitive Services” • https://www.microsoft.com/cognitive-services • https://gallery.cortanaintelligence.com/machineLearningAPIs Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Thanks! Questions?
Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek Demos available on GitHub https://github.com/yorek/devweek2016

Azure ML: from basic to integration with custom applications

  • 1.
    Azure Machine Learning frombasic to integration with custom application Davide Mauri Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 2.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek About Me Microsoft SQL Server MVP Works with SQL Server from 6.5, on BI from 2003 Specialized in Data Solution Architecture, Database Design, Performance Tuning, High-Performance Data Warehousing, BI, Big Data President of UGISS (Italian SQL Server UG) Regular Speaker @ SQL Server events Consulting & Training, Mentor @ SolidQ E-mail: dmauri@solidq.com Twitter: @mauridb Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
  • 3.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek Agenda • Machine Learning, what’s that? • Supervised & Unsupervised methods • Tools & Languages • Experimenting On-Premises • IPython & R • SQL Server 2016 and R • Azure Machine Learning • AzureML Studio • Jupyter Notebooks • Integrating AzureML into custom applications
  • 4.
    Machine Learning What’s that? Jointhe conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 5.
    Machine Learning • Algorithmsthat learn from data • Nothing really new from a scientific point of view • "Field of study that gives computers the ability to learn without being explicitly programmed“ - 1959, Arthur Samuel • Requires *a lot* of compute power (even for not-so-big-data) • Azure, here we come!  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 6.
    Machine Learning • Veryuseful for • Identify unknown and complex pattern • Identify hidden correlations • Automatically classify data • Predict future trend and/or values basing on past knowledge Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 7.
    Machine Learning • Thanksto the cloud it’s now possible to integrate ML Algorithms into Line-Of-Business applications • Choose the algorithm • Train it • Expose as a RESTful Web Service • Call it from you App • You’re Happy  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 8.
    Machine Learning • Twomain categories (but sometimes are even divided in up to five categories!) • Supervised • Unsupervised • Supervised: humans (usually) teach to algorithms what is the expected result • Unsupervised: algorithms tries to autonomously identify patterns and rules in given dataset Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 9.
    Languages • Most commonlanguages used for machine learning • R • Python • Less common but on the rise • Julia • Scala • Go • Rust Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 10.
    Tools - Python •Python Packages • Scikit-Learn • SciPy, NumPy, Pandas, Matplotlib, Seaborn • Jupyter (was: IPython) • Anaconda • Microsoft Data Science Virtual Machine • Pytools for Visual Studio Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 11.
    Tools - R •R • Microsoft Open R Portal • Microsoft R Open (MRO) • RStudio • R Tools for Visual Studio • Microsoft Data Science Virtual Machine • Anaconda • https://www.continuum.io/conda-for-r Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 12.
    Datasets • To learnML, sample and well-known datasets are needed • Here some places where nice Datasets can be found • http://archive.ics.uci.edu/ml/datasets.html • http://www.kdnuggets.com/datasets/index.html • http://homepages.inf.ed.ac.uk/rbf/IAPR/researchers/MLPAGES/mldat.htm • https://en.wikipedia.org/wiki/Data_set#Classic_datasets • https://mran.revolutionanalytics.com/documents/data/ Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 13.
    IRIS Dataset • 150instances of Iris Flowers • 3 classes: Virginica, Versicolor, Setosa • 4 features: Sepal Width & Length, Petal Width & Length • One of the most used for educational purposes • Simple, but…. • Un class is linearly separable • Other two classes are NOT linearly separable • Available at UC Irvine Machine Learning Repository • http://archive.ics.uci.edu/ml/datasets/Iris Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 14.
  • 15.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments On-Premises
  • 16.
    SQL Server 2016and R Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 17.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments with R and SQL Server 2016
  • 18.
    Azure ML Studio Onthe Cloud! Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 19.
    AzureML Studio • www.azureml.com •Azure ML Studio • Web application (“Workspace”) for developing ML solutions • Part of the “Cortana Analytics Intelligence Suite” • Development Process • Experiment -> Score -> Evaluate • Publish Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 20.
    AzureML Studio • “DemocratizeMachine Learning” • Free Tier Available • 10 GB Storage Space • 1h max experiment duration • Staging Web API • Standard Tier • Costs per “Seat”, Studio and API Usage • https://azure.microsoft.com/en-us/pricing/details/machine-learning/ Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 21.
    AzureML Studio • FullyInteractive Environment • Fully Integrated with Azure Ecosystem, but not only that  • Very easy to use external data sources • Support Jupyter/IPython Notebooks! • Even more Interative!  Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 22.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments On-Premises
  • 23.
    AzureML Web Services •Once the experiment has been created, tested and validated • NOTE! AzureML Web Services *does not* support CORS right now • So it’s ok to call from a server-side script • If you want to call it directly from Javascript you need to go through Azure Management API • And configure the Policy to allow CORS Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 24.
    AzureML Web Services •Can be created also on-premises with R and Python Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 25.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek DEMO Experiments With Web Services
  • 26.
    What’s more • Inaddition to the “usual” Machine Learning objects Azure offers specialized API and the “Cognitive Services” • https://www.microsoft.com/cognitive-services • https://gallery.cortanaintelligence.com/machineLearningAPIs Join the conversation on Twitter: @DevWeek // #DW2016 // #DevWeek
  • 27.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek Thanks! Questions?
  • 28.
    Join the conversationon Twitter: @DevWeek // #DW2016 // #DevWeek Demos available on GitHub https://github.com/yorek/devweek2016

Editor's Notes

  • #16 Sample usage of Python and R from Jupyter
  • #18 Sample R with SQL Server 2016 (create and store model)
  • #23 Create an experiment to test ML on the IRIS Dataset