EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

How to Visualize Azure Machine Learning Models with MicroStrategy


Shugo Sonobe

Principal Consultant • MicroStrategy


Azure Machine Learning is a cloud predictive analytics service that makes it possible to quickly create and deploy predictive models as analytics solutions. Azure Machine Learning not only provides tools to model predictive analytics, but also provide a fully managed service that you can use to deploy your predictive models as ready-to-consume web services.

 

ka04W000001IrZ4QAK_0EM440000002LEO.jpeg

(From https://docs.microsoft.com/en-us/azure/machine-learning/ )
 
As the graph of workflow describes, after user train/optimize the predictive models and deploy the predictive models as web services, as a BI tool, we can consume the web services to provide prediction capability for new data. Following are the steps for this process.
1.Create a predictive solution in Azure
To create a predictive solution in Azure for Strategy, we need to follow these steps:

  1. Create a Machine Learning work-space
  2. Uploading existing data for training and testing the model
  3. Create an experiment
  4. Train and evaluate the models
  5. Deploy the web service


Please refer to this document (https://docs.microsoft.com/en-us/learn/paths/create-machine-learn-models/ ​​​​​​​) to complete the steps.
 
In this example, we want to predict the Income category based on features like age, education, occupation and so on, part of the training data looks like below:

ka04W000001IrZ4QAK_0EM440000002LEd.jpeg

 
We use the Two-Class Boosted Decision Tree algorithm for the model. The training experiment is shown in below the below screenshot of the Azure Machine Learning Studio:

ka04W000001IrZ4QAK_0EM440000002LEi.jpeg

2.Prepare Strategy environment

1)Install R


In a Windows environment, Users can install Microsoft R. Users can also use CRAN to download R binary distribution corresponding to any operating system and install it. 

  • If you are using 3-tier Developer or Web, R needs to be installed on the same machine as I-Server;
  • if you are using Strategy Desktop, R needs to be installed on the same machine as Desktop.

Users can leverage Microsoft Visual Studio for R development in a Windows environment (https://www.visualstudio.com/vs/rtvs/). Users also have the option to use the free IDE R studio (https://www.rstudio.com/) for your R development as it is available for all operating systems. 
 

2)Install StrategyR package

On the machine you have R installed, download R Integration Pack (https://rintegrationpack.codeplex.com/releases/view/630028) for your platform, and install it.
3.Prepare R code to access web service
After you have deployed the prediction model into web service, in the Consume tab of the web service dashboard, you will find the API Key and Sample Code in R for the Request-Response mode.
You need to modify 3 places in the code to make it work in Strategy.

  • Replace the API key with yours;
  • Modify the hard-coded input data to read from Strategy metrics;
  • Modify the output to make it a vector can be used by Strategy.

4.Visualize the model in Strategy

1)Using deploy to define metric expression


In R studio, run the following commands:
library(StrategyR)
deployR()

In the deployR editor, open your R script file, and define the input, output and other parameters. You get the metric expression on the right bottom.

ka04W000001IrZ4QAK_0EM440000002LEs.jpeg

Click Save to save the final R script.

 

2)Define derived metrics in Dashboard


In this case, we plan to use the machine learning model to predict the yearly income for individuals based on a variety of attributes. 
 
Using the above R script, we can make these predictions for new data in Strategy by creating a new metric as shown below. 

ka04W000001IrZ4QAK_0EM440000002LEx.jpeg

 
Once the metric is defined, Strategy connects to the web service that was created in Microsoft Azure ML studio to score the individual rows and provide a prediction of the income for everyone based on their individual attributes. 

ka04W000001IrZ4QAK_0EM440000002LF2.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

May 8, 2017

Last Updated:

May 8, 2017