Visual Programming with Orange Tool
In this blog, I am going to describe about more different features of Orange Tool. If you want to learn basic of Orange Tool then see my previous blog Getting started with Orange Tool. In this blog, I will show how to Split our data in training data and testing data in Orange and how to use cross validation in Orange tool.
we will see Compare different machine learning models for a particular dataset on basis of their scores like accuracy, F1, Precision, Recall using Cross-validation as well as splitting datasets into train and test datasets.
Creating the workflow
First, we use the File widget in the canvas and load the inbuilt titanic dataset in the workflow.
Next send the input data to widget Data Sampler. Data Sampler selects a subset of data instances from an input data set. It outputs a sampled and a complementary data set (with instances from the input set that are not included in the sampled data set).
The output is processed after the input data set is provided and Sample Data is pressed. Here I sampled the data 70% output sampled data and 30% will be complementary data set.
Now, we need to send this sample data from Data Sampler to Test and Score. The widget tests learning algorithms. Different sampling schemes are available, including using separate test data.
Test and Score First shows a table with different classifier performance measures, such as classification accuracy and area under the curve. and Second, it gives outputs evaluation results, which can be used by other widgets for analyzing the performance of classifiers, such as ROC Analysis or Confusion Matrix.
Here we send the sample data from Test and Score to three different learning algorithms namely Neural Network, Naive Bayes, and Logistic Regression.
Sampling using Cross Validation in Orange
Cross-validation is a resampling procedure used to evaluate machine learning models on a limited data sample.
Cross-validation splits the data into a given number of folds (usually 5 or 10). Cross-validation is primarily used in applied machine learning to estimate the skill of a machine learning model on unseen data.
Split data in training data and testing data in Orange
To split the data into train and test dataset, we will send the 70% of the sampled data from Data Sampler as the train data and remaining 30% data as the test data by clicking on the link between Data Sampler and Test and Score. In there set the link from Data Sample box to Data box and Remaining Data box to Test Data as shown in below figure.
Now, there will be two flows setup from Data Sampler to Test and Score widget: one flow which sends the 70% Data Sample i.e Train data to Test and Score and second flow which sends the 30% Remaining Data i.e Test Data to Test and Score widget.
Now get the comparison scores of the three different algorithms by testing on the train data. To do so double click on the Test and Score widget and choose the option of Test on train data there and get the scores for all three algorithms.
To test the learning algorithms on the basis of the test data choose the option of Test on test data in the Test and Score widget.
So, we have seen how we can sample our data and compare different learning algorithms to find out which is the best algorithm for our data set using the Orange tool. You can explore more about the Orange tool here.
Thank You!!