# understanding azure machine learning - wintellect azure machine learning studio azure machine...

Post on 04-Jun-2020

7 views

Embed Size (px)

TRANSCRIPT

Understanding Azure Machine Learning

Build sophisticated machine-learning models quickly and harness the power of predictive analytics to aid your research and build smarter apps

October 2016

achine learning, which facilitates predictive analytics using large volumes of data by

employing algorithms that iteratively learn from that data, is one of the fastest

growing areas of computer science. Its uses range from credit-risk prediction and

spam filtering to optical character recognition (OCR) and online shopping recommendations. It

makes us smarter by making computers smarter. And its usefulness will only increase as more

and more data becomes available and the desire to perform predictive analytics from that data

– or simply find patterns in it – grows, too.

Though few outside of the data-science community are aware that it exists, machine learning

touches lives every day. When your credit-card company calls to validate a transaction that just

occurred, it was probably machine learning that tipped them off to possible fraud. The model

was trained with information regarding millions of credit-card transactions, each classified as

fraudulent or not-fraudulent. With a model thusly trained, each new transaction is run through

the model and its validity is determined with an astonishing degree of accuracy.

Azure Machine Learning is a cloud-based predictive-analytics service that offers a streamlined

experience for data scientists of all skill levels. It's accompanied by the Azure Machine Learning

Studio, which is a browser-based tool for building machine-learning models using a drag-and-

drop paradigm. It comes with a library of time-saving experiments and features best-in-class

algorithms developed and tested in the real world by Microsoft businesses such as Bing and

Hotmail. And its built-in support for the R programming language and Python means you can

build custom scripts to customize your model. Once you've built and trained a model in Azure

Machine Learning Studio, you can easily expose it as a Web service that is consumable from a

variety of programming languages, or share it with the community by placing it in the Cortana

Intelligence Gallery.

The Science of Machine Learning

Machine-learning models fall into two broad categories: supervised and unsupervised.

In supervised learning, the model is trained using existing data for the purpose of predicting

outcomes from future data. For example, suppose you have a large volume of data regarding

cancer patients and their age, socioeconomic backgrounds, and lifestyle habits, and you want to

build a model that predicts the probability that a new patient will be diagnosed with cancer.

You could achieve this by building a supervised-learning regression model. Regression models

use regression algorithms to predict numeric outcomes – for example, the probability of

contracting a disease – from a range of features such as age, gender, income level, height, and

weight.

M

https://azure.microsoft.com/services/machine-learning/ https://studio.azureml.net/ https://studio.azureml.net/ https://www.r-project.org/ https://www.python.org/ https://gallery.cortanaintelligence.com/ https://gallery.cortanaintelligence.com/

Regression models rely on algorithms that are common in statistical analysis. The simplest

regression algorithm is univariate linear regression, also known as simple linear regression,

which models the relationship between a single independent variable X and a dependent

variable Y by best-fitting the equation of a line (hence “linear regression”) to a set of inputs, as

shown in Figure 1. Other commonly used regression algorithms include multivariate linear

regression, which accepts multiple input values X, neural network regression, which “learns” by

mimicking the behavior of the human brain, and decision trees, which use statistical methods to

split the data into a tree of hierarchically arranged nodes from which an outcome can be

predicted by following a path from top to bottom.

Figure 1: Univariate linear regression

Regression models are very common in supervised learning, but so are classification models.

The purpose of a classification model is to predict an outcome from a finite range of possible

outcomes – for example, classifying a credit-card transaction as fraudulent or not-fraudulent or

an e-mail as spam or not-spam. Classification models employ various classification algorithms

such as Support Vector Machine (SVM), Bayes Point Machine, and logistic regression (also

known as “logit regression”), which uses regression to estimate the probability of each outcome

in a finite set of outcomes.

Regression and classification are instances of supervised learning and are used to perform

predictive analytics – given a set of inputs, predict the outcome based on patterns identified in

the training data. Unsupervised learning, by contrast, seeks to find patterns in the data and use

those patterns to identify groups or clusters of similar objects. A common application for

unsupervised learning is identifying groups of customers with similar buying habits or

socioeconomic backgrounds in order to develop targeted marketing strategies.

Unsupervised learning algorithms abound, but one of the most common is k-means clustering,

which is illustrated in Figure 2. The goal of k-means is to divide a set of n data points into a set

of k groups. It is typically implemented using an iterative algorithm that begins by grouping data

points by their proximity to k centroids and computing a new centroid for each group, and then

repeating until the centroids no longer move. Like all machine-learning algorithms, k-means has

strengths and weaknesses. Among its weaknesses is the fact that the outcome tends to be very

sensitive to the initial centroid selections.

Figure 2: k-means clustering

Even for a trained data scientist, picking the right algorithm for a robust and accurate machine-

learning model can be challenging. For those not versed in data science, it can be daunting. To

help, Microsoft offers the Machine Learning Algorithm Cheat Sheet (Figure 3), which helps

identify candidate algorithms based on the model’s intended goal. The latest version is

available at http://aka.ms/MLCheatSheet. In addition, the article How to choose algorithms for

Microsoft Azure Machine Learning offers valuable insights into choosing an algorithm.

http://aka.ms/MLCheatSheet https://azure.microsoft.com/documentation/articles/machine-learning-algorithm-choice/ https://azure.microsoft.com/documentation/articles/machine-learning-algorithm-choice/

Figure 3: Microsoft’s Machine Learning Algorithm Cheat Sheet

A second challenge in implementing a machine-learning model is coding the algorithm. Azure

Machine Learning helps out in this regard by providing canned implementations of 25 of the

most commonly used algorithms in machine learning. The goal is to make machine learning

more approachable by not requiring a data scientist to be a programmer as well as a machine-

learning expert. You can always code algorithms of your own in R or Python. But the whole

point of Azure Machine Learning is that you rarely have to, hence the reason it is sometimes

described as machine learning for the masses.

Azure Machine Learning

Azure Machine Learning combines Software-as-a-Service (SaaS) with a sleek visual editor (Azure

Machine Learning Studio) to simplify the task of building and deploying machine-learning

models. The general process for building such a model is illustrated in Figure 4, which is taken

from the whitepaper Introducing Azure Machine Learning by David Chappell.

http://www.davidchappell.com/writing/white_papers/Introducing-Azure-ML-v1.0--Chappell.pdf

Figure 4: The machine learning process

Workflow begins with the data itself,

which can be uploaded to ML Studio

or imported from a variety of data

sources, including REST endpoints,

Hive queries, and Azure Storage. ML

Studio supports a variety of data

formats, including CSV, TSV, OData,

RData, and even zip files.

Because real-world datasets typically require preparation in order to be useful in machine

learning, the data is then preprocessed or “cleaned.” Cleaning typically involves filtering out

rows or columns containing data that has little or no influence on the outcome, removing (or

replacing) missing values, and removing duplicate rows and outliers. Preprocessed data is then

input to the model, which iterates over the data until it finds a best fit for the selected machine-

learning algorithm in a process known as “training.” Once training is complete, the model is

“scored” to evaluate its accuracy. The finished model can take input structured in the same

manner as the training data and predict what the output will be.

Building an ML model with other toolsets frequently involves writing lots of code: code to clean

the data, code to train the model, co