Building Models with Azure Machine Learning R Script
Microsoft Azure cloud services has significantly expanded their Machine Learning capabilities, which includes building models with R Script. We’ll show you how this is done and what scripts to use to get started.
Microsoft Azure Machine Learning now supports R Script, which is a simple text file containing nearly the same commands one would enter on an R command line. Azure Machine Learning R Script capabilities allow users to import and run existing R codes within any Azure experiment.
Using the “Create R Model” module, developers can create an untrained model from an R script, then use the “Train Model” module to effectively teach the model on a dataset. Afterwards, the model can be passed into the “Score Model” to make further predictions.
Smartbridge is a Microsoft Azure Partner
Building Azure Machine Learning R Script Models
This guide uses samples from the Azure AI Gallery to provide an accurate reference. To start, we’ll need to add the “Create R Model”, “Train Model”, and “Score Model” modules in the Azure Machine Learning platform.
Here we have a sample R Script you could use to train your R model. It loads an R package, creates the model, and configures label column accordingly:
To explain the example script above, the library (e1071) loads the R package e1071 with the “Naïve Bayes” classifier algorithm. The subsequent lines get the feature and label columns from the dataset, and combine them into a new R data frame called “train.data”.
Next, we have a sample scoring script as show below:
Let’s break down this particular script:
Make the Most of Azure Machine Learning Capabilities!
After running the experiment, you can publish it as a web service whenever you feel the need. Although this is a fairly simple sample, this is a great way to get started creating your own custom models, and further explore the depths of Azure Machine Learning R Script capabilities.
Looking for more on Azure and Systems Modernization?
Explore more insights and expertise at smartbridge.com/modernization
There’s more to explore at Smartbridge.com!
Sign up to be notified when we publish articles, news, videos and more!
Other ways to