Algorithms for pattern recognition

Basic Classification using MATLAB

No comments
MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, we will analyse data, develop algorithms, and create models and applications.

The Fisher's Iris data set is a multivariate data set introduced by Sir Ronald Fisher (1936) as an example of discriminant analysis. It is sometimes called Anderson's Iris data set because Edgar Anderson collected the data to quantify the morphologic variation of Iris flowers of three related species.

We will use MATLAB software to classify the Fisher's IRIS dataset and then will get into detail of this code line by line

Preview
load fisheriris;
gscatter(meas(:,1), meas(:,2), species,'rgb','osd');
xlabel('Sepal length');
ylabel('Sepal width');
Output

Getting into detail of this code
First line was
load fisheriris;

What this line does?
Loads inbuilt Fisher's iris data into workspace as a collection of matrix(meas) with dimension 150x4 and vector(species) with dimension 150x1

Second line was
gscatter(meas(:,1), meas(:,2), species,'rgb','osd');

What this line does?
Creates a scatter plot of  
  • meas(:,1)  [column1 from meas matrix]
  • meas(:,2)  [column2 from meas matrix]
 grouped by species vector in rgb[red-green-blue] with osd symbols
Third line
xlabel('Sepal length');
ylabel('Sepal width');

What this line does?
Adds label to the graph, xlabel adds label to x-axis and ylabel adds label to y-axis.

No comments :

Post a Comment