View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
4-Nearest Neighbor on iris recognition using randomized partitioning.

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.0
4.0 | 1 rating Rate this file 15 Downloads (last 30 days) File Size: 2.04 KB File ID: #37827 Version: 1.0
image thumbnail

4-Nearest Neighbor on iris recognition using randomized partitioning.

by

 

Matlab Script to find the 4 - nearest neighbors (kNN) for IRIS dataset

| Watch this File

File Information
Description

% 1: Load iris.mat file which contains Iris data and its label
% seperately.
% 2: Randomize the order of data for each iternation so that new sets of
% training and test data are formed.
%
% The training data is of having size of Nxd where N is the number of
% measurements and d is the number of variables of the training data.
%
% Similarly the size of the test data is Mxd where M is the number of
% measurements and d is the number of variables of the test data.

% 3: For each observation in test data, we compute the euclidean distance
% from each obeservation in training data.
% 4: We evalutate 'k' nearest neighbours among them and store it in an
% array.
% 5: We apply the label for which distance is minimum
% 5.1: In case of a tie, we randomly label the class.
% 6: Return the class label.
% 7: Compute confusion matrix.

Acknowledgements

K Nearest Neighbors inspired this file.

Required Products Simulink Verification and Validation
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
18 Jun 2016 amit pandey

when iris.mat isnt included how can one run it.

Comment only
25 May 2016 Fernando Barraza

The iris.mat file is missing, somebody has it?

Comment only
12 Apr 2016 Aish

Aish (view profile)

Error: Undefined function or variable 'irisdata'.
How to correct this?

Comment only
01 Apr 2014 Mohamed

Mohamed (view profile)

It is well documented, but iris.mat is not included !

Contact us