Logistic Regression with Azure Machine Learning

Azure Machine Learning (AML) is a cloud-based machine learning platform that has a very cool GUI. I don’t use AML very often because I prefer using raw code to using tools. I decided to see if anything was new with AML since the last time I used it, by putting together a logistic regression demo — the simplest possible ML model.

ML always starts with data. I created a tab-delimited text file with 20 items from the famous Iris Dataset. There were 10 class “0” items (Iris setosa) and 10 class “1” items (Iris versicolor).

Next I launched a browser and went to the studio.azureml.net site. I had an existing Azure ML account otherwise I’d have had to create one, which can be a surprisingly annoying process.

In the lower left of the GUI, I clicked on the giant NEW item and then selected the New Dataset item. I pointed to my text file and told Azure ML it was tab-delimited and did not have a header.

I clicked the NEW again and this time created a new Experiment, using the Blank Experiment template. I dragged my text file from the Saved Datasets area onto my experiment workspace.

Next I used the Search module to find and add a Two-Class Logistic Regression module. I edited the L1 and L2 weights to 0, and set the Random Seed value to 0.

Next I added the Train Model, Score Model, and Evaluate Model modules, and connected them up. For the Train Model module I specified that the Labels to predict were located in column 1. If my data file had headers I could have specified by column name.

I named my experiment “Simple Logistic Regression” and clicked the Run item. After the experiment ran, I selected the Evaluate Model module, and selected the Visualize option. The classification model predicted all 20 items correctly, as expected for a simple linearly separable problem.

In this example, I assumed that my data was all training data. I could have used the Split Data module to create training and test data.

Azure ML – not my favorite way to do machine learning (but I’m probably a minority), but quite possibly a good way to get started for people who are relatively new to ML.

This entry was posted in Machine Learning. Bookmark the permalink.