1-nearest neighbor with accuracy, precision and recall

INPUTS:TEST SET,TRAINING SET,GROUP,K-VALUE,DISTANCE,RULE OUTPUT:ACCURACY,PRECISION,RECALL
555 Downloads
Updated 30 May 2011

View License

TO FIND THE K NEAREST NEIGHBOUR ::

FORMULA ::
Class = knnclassify(Test, Training, Group, k, distance, rule)

INPUTS :-
TEST SET, TRAINING SET, GROUP, VALUE OF K, DISTANCE, RULE

TEST, TRAINING - MATRIX
GROUP - GROUPING OF ROWS
K - NUMBER OF NEAREST NEIGHBOR USED IN CLASSIFICATION
DISTANCE - EUCLIDEAN
RULE - NEAREST

OUTPUT :-
CLASS MATRIX WHICH SHOWS THE NEAREST NEIGHBORS OF EACH ROW ie.,ROW 1 OF TEST IS CLOSEST TO ROW 3 OF TRAINING.THEN I CALCULATED TRUE POSITIVE, TRUE NEGATIVE, FALSE POSITIVE, FALSE NEGATIVE USING THAT I CALCULATED ACCURACY, PRESICION, RECALL

Cite As

Aravind Manimaran (2024). 1-nearest neighbor with accuracy, precision and recall (https://www.mathworks.com/matlabcentral/fileexchange/31612-1-nearest-neighbor-with-accuracy-precision-and-recall), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0