K-nearest neighbor for English letter classification by doing random partition.

Evaluates 4-nearest neighbor for English letter classification by doing random partition.

You are now following this Submission

% 1: Load letter.mat file which contains letter 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.

Cite As

lavya Gavshinde (2026). K-nearest neighbor for English letter classification by doing random partition. (https://se.mathworks.com/matlabcentral/fileexchange/37829-k-nearest-neighbor-for-english-letter-classification-by-doing-random-partition), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: K Nearest Neighbors

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0