Page 12 - MSDN Magazine, November 2017
P. 12

ArtificiAlly intelligent FRANK LA VIGNE
Exposing Machine Learning Models from Azure Machine Learning Studio
One of the key drivers of innovation in the machine learning (ML) and artificial intelligence (AI) space has been the fact that much of the results of cutting-edge research has “left the lab” and is available to the public. Services such as Cortana and Skype Translate that rely on years of work in speech recognition and linguistic analysis are in the hands of users worldwide.
In my previous column (msdn.microsoft.com/mt826348), I demonstrated how to create an ML model in Azure Machine Learning Studio. Using a sample experiment as a starting point, I created a model that predicted whether a flight would be canceled with an accuracy rate of slightly greater than 80 percent. While this model might be useful on its own, the full transformative power of AI would be realized if I made this model available to more than just the data scientists on my team. What if this predictive model were exposed to business analysts? What if it was made easy for them to consume the predictive model from within Excel? What if the model was exposed to app developers to embed into any number of applications?
In this article, I’ll demonstrate how to expose ML models created in Machine Learning Studio to non-data-scientist users.
Fortunately, Machine Learning Studio makes it straightforward to expose ML models via
a Web service.
Creating a Web Service in Machine Learning Studio
Fortunately, Machine Learning Studio makes it straightforward to expose ML models via a Web service. Browse over to Machine Learning Studio at studio.azureml.net. If you followed the steps in my previous column, please open up the Binary Classification: Flight
Figure 1 The Set Up Web Service Context Menu in Azure Machine Learning Studio
delay prediction experiment. If not, go ahead and follow the steps I outlined last month to create the experiment.
Once loaded, there should
be a button at the bottom of the
Web page called Set Up Web
Service. Click on it and click
on the Predictive Web Service
[Recommended] option in the
context menu that appears (see
Figure 1). If the option to cre-
ate a Predictive Web Service is greyed out, then you might have to run the experiment again. Click the Run button to the immediate left of the Set Up Web Service button as shown in Figure 1.
Once you click the menu option, the dialog in Figure 2 will appear. Machine Learning Studio will prompt you to pick a Train Model module. Why? Two ML models are trained in this exper- iment: one using a Two-Class Boosted Decision Tree algorithm and the other using a Two-Class Logistic Regression algorithm. Recall that the Two-Class Logistic Regression achieved an accu- racy of 81.7 percent, while the Two-Class Boosted Decision Tree achieved 80.6 percent. The model I want to expose as a Web ser- vice, therefore, is the model created with the Two-Class Logistic Regression algorithm.
The right side of the experiment layout—after the project splits into two paths—appears as what’s shown in Figure 3. The Tune
8 msdn magazine
Figure 3 The More Accurate Model Is the Two-Class Logistic Regression, Enhanced by Tune Model Hyperparameters
Figure 2 Azure Machine Learn- ing Studio Will Prompt You to Pick a Train Model Module










































































   10   11   12   13   14