Introduction
The Machine Learning Toolbox uses several datasets to demonstrate the concepts of data clustering and pattern recognition. For pattern recognition, the following 3 dataset are commonly used:
- Iris dataset
- Wine dataset
- Abalone dataset
In fact, these datasets are available from UCI Machine Learning Repository, which is maintained by Donald Bren School of Information and Computer Science at University of California at Irvine. There are numerous dataset in this website together with their documentations, so researchers on machine learning can use these common datasets for fair evaluation and comparisons. In order to facility the access of the dataset via MATLAB, we usually use a structure variable DS (dataset) for storing all the information of a dataset, as explained next:
- DS: the structure variable for storing all information of a dataset
- DS.input: the input part (also known as features) of the dataset
- DS.output: the output part (also known as desired classes or ground truth) of the dataset. Each entry of this vector is an index into a class denoted by DS.outputName.
- DS.dataName: a string representing the name of this dataset
- DS.inputName: a cell string that represents the name of the inputs.
- DS.outputName: a cell string that represents the name of the output classes. Note that each entry in DS.output is actually an index into this cell string. As a result, the range of DS.output should be between 1 and length(DS.outputName) inclusively.
Also we have prepared a function prData.m for returning these three datasets. For instance, if you want to read the commonly used IRIS dataset, please follow next example:
DS = prData('iris')
DS =
struct with fields:
dataName: 'iris'
inputName: {'sepal length' 'sepal width' 'petal length' 'petal width'}
outputName: {'Setosa' 'Versicolour' 'Virginica'}
input: [4×150 double]
output: [1×150 double]
From the above example, we know that:
- DS.dataName is 'iris', representing the name of this dataset.
- DS.inputName is a cell string of length 4, representing the name of the 4 input features.
- DS.input is a matrix of 4x150, indicating the dimensions and number of the feature vector is 4 and 150, respectively.
- DS.output is a vector of 1x150, representing the output classes for these 150 feature vectors. Possible values of DS.output are 1, 2, and 3, indicating the index into the 3 classes whose names are denoted in DS.outputName.
- DS.outputName is a cell string of length 3, representing the name of the classes in this dataset.
Based on the dataset DS, we have prepared funtions for analyzing and visualizing the dataset along different perspectives:
- classClassSize(DS): Compute the size of each class
- dsProjPlot1(DS): Plot the classes w.r.t. the projected 1D features
- dsProjPlot2(DS): Plot the classes w.r.t. the projected 2D features
- dsProjPlot3(DS): Plot the classes w.r.t. the projected 3D features
- dsFormatCheck(DS): Check the format of the dataset
- dsNameAdd(DS): Add names to the inputs and outputs of a given dataset
- dsRangePlot(DS): Plot the range of each input of a given dataset
- dsScatterPlot(DS): Scatter plot of a dataset in a 2D space
- dsScatterPlot3(DS): Scatter plot of a dataset in a 3D space
Copyright 2011-2016 Jyh-Shing Roger Jang.