Header Ads

Azure Machine Learning: Classification Predictive Analysis using Iris Dataset

Machine learning (ML) and artificial intelligence (AI) are the most difficult domains in terms of developing & implementing. There are a lot of pre and post processes involved while implementing a machine learning base solution to solve even the simplest problem.




In general, machine learning implementation involve following steps i.e.
  1. Preparation of dataset samples.
  2. Analysis of dataset samples.
  3. Training the system with dataset samples.
  4. Evaluating resultant dataset outcome to measure the accuracy of the solution.
The above four steps seems really simple in theory. However, when you try to implement these above four steps into the world of computing then a lot of resources and limitations require your attention to achieve desire outcome. This is however, the part where we are simply trying to implement our solution to achieve the desire accuracy and we have not even yet touched the application part of what our solution is capable of offering.

In other words, machine learning solutions in general will take almost 90% of our efforts & focus to improve our solution's accuracy, while reaming 10% of our efforts & focus may or may not work towards application implementation of our solution.

So, Machine learning domain is resource & time consuming yet very satisfying, since, both machine learning and artificial intelligence are the only domains that are capable of solving problems beyond our imagination.

Taking these revolutionary domains in account, Microsoft introduce Microsoft Azure platform and take away most of the development & implementation tensions of machine learning & artificial intelligence domains leaving researchers, developers and enterprises to focus on the main goal rather than be exhaustive over hows of the implementation processes of the machine learning base solutions in order to achieve revolutionary outcomes.

So, in today's Tutorial I shall be demonstrating the classical classification predictive analysis problem using iris dataset in Microsoft Azure Machine Learning Studio. I will be focusing on the simplicity that Microsoft Azure Machine Learning Studio has offered while implementing my solution in few minutes with few clicks. There is not a single line of code involved here and just like that in few clicks my entire solution for classification predictive analysis problem will be implemented. 

I will be posting a separate tutorial which will focus on the application development of this machine learning model base on iris dataset. So, stay tune.

As I have mentioned that I am using the iris dataset, so, you can download it via its official repository at UCI Machine Learning Repository or you can download the iris dataset as I have provided in this tutorial. I would suggest to download iris data from this tutorial as I have make few changes in the original iris dataset i.e. introducing new numeric column that represents the types of iris classes.

Download Now!

Following are some prerequisites before you proceed further in this tutorial i.e. 

Prerequisite

  1.  Knowledge of Iris dataset
  2. Basic understanding of machine learning concept.

Let's begin the fun.

1) Create account at Microsoft Azure Machine Learning Studio if you do not already have.
2) Click on Datasets and then new buttons as shown in the snippet i.e.


3) Now, upload the iris dataset as provided in this tutorial as shown below i .e.





You will see that your iris dataset is now in the Microsoft Azure Machine Learning Studio.

4) Click on Experiments and then click New as shown below i.e.


5) Now, click on Blank Experiment as shown below i.e.


6) Rename your experiment window to "Iris Dataset Azure ML" as shown below i.e.


7) Creating machine learning model in Microsoft Azure Machine Learning Studio is just a matter of clicks. So, type iris in the left side search experiment items search box as shown below i.e.


In the above snippet, you will see that iris dataset is also provided by Microsoft Azure Machine Learning Studio as well which contains only two classes, while classic iris dataset contains three classes.

8) Drag the "iris.csv" dataset into your experiment window as shown below i.e.


9) Right click on the "iris.csv" module on the experiment window and then click "Visualize" as shown below i.e.


You will be able to see your dataset inside the Microsoft Azure Machine Learning Studio as shown below i.e.


10) Now, type "split" in the search box and drag the "Split Data" module into your experiment window. Also connect the "iris.csv" module with the "Split Data" module by simply dragging then set the "Fraction of rows in the first output dataset" value to "0.75"  as shown below i.e.



We have used the "Split Data" module to separate our training data from our test data in the provided dataset, so, we can measure the accuracy of our Machine learning model i.e. we take 75% data as training data and remaining 25% data will be treated as test data.

11) Now, let's add the machine learning algorithm to our experiment. So, type "multiclass" in the search box and drag "Multiclass Neural Network" module into your experiment window and let the properties in the property window as it is i.e.


You can experiment with any multiclass classification module as provided in Microsoft Azure Machine Learning Studio or you can import your own multiclass algorithm into the Microsoft Azure Machine Learning Studio.

12) Now type "train model" in the search box and drag the "Train Model" module into the experiment window, then connect the "Multiclass Neural Network" module & "Split Data" module with the "Train Model" module by simply dragging as shown below i.e.



You will notice an error symbol on the "Train Model" module as shown in the above snippet. This is because we have not tell our training model to train on which feature (column) of our dataset which is our predictive feature (column). So, click on the "Launch column selector" and then choose "class-type" column as shown below i.e.




13) Now click on "Run" to see that whether our experiment has any error or not so far i.e.



You will see a green tick icon on each modules that signifies that there is no error so far.

14) Now, type the "score model" in the search box and drag the "Score Model" module on the experiment window and connect the "Train Model" module and "Split Data" module to the "Score Model" as shown below i.e.


Remember that in step 10 I have mentioned that we use "Split Data" module to separate our training data and experiment data in order to measure the accuracy of our machine learning model. So, for this reason I have connected "Train Model" module which contains 75% data as trained from our "Split Data" module as we have configured it and direct "Split Data" module which contain the remaining 25% untrained test data with the "Score Model" module which will show us the accuracy of our machine learning model.

15) Let's run the experiment again i.e.


16) Now, right click the "Score Model"  module and then click the "Visualize" as shown below i.e.



So, in the above snippet you will see that "Scored Labels" column which is actually the predictive column matched identically with the original column "class-type" of our dataset proves that our machine learning model is quite accurate. The probability of each class is also mentioned per instant of each sample. Also, observe here that our resultant rows are 37 in number this is because as we have chosen 25% of our data as test data. Our dataset contains 150 total rows that means simply that 37 rows will be test samples which remaining will be the training data.

This is the beauty of Microsoft Azure Machine Learning Studio that I can simply create my machine learning model on the go and then so easily use test data from the given dataset instead of going into the hustle of first putting effort into developing & implementing my machine learning model and then worry about the test data to measure the accuracy of my machine learning model.

17) Now, type "eval" in the search box and drag the "Evaluate Model" module into the experiment window then connect the "Score Model" module with "Evaluate Model" module and click the run button. Then right click the "Evaluate Model" module and click "Visualize" as shown below i.e.





"Evaluate Model" module is simply to observe the statistics of our machine learning model. You can use any "Evaluate Model" module as provided by the Microsoft Azure Machine Learning Studio.

Conclusion

In this tutorial, you will learn to create machine learning model in Microsoft Azure Machine Learning Studio, you will learn to import your own dataset into Microsoft Azure Machine Learning Studio, you will learn about different machine learning modules of Microsoft Azure Machine Learning Studio, you will learn to measure the accuracy of your machine learning model, you will learn to generate the evaluation statistics that your model produces and you will also learn to use train data and test data from the provided dataset.

3 comments: