Index of chosen Nearest Neighbor from Classification Learner kNN Function
Show older comments
Hi,
I created a trained kNN Classification model using the Classification Learner App in order to classify new data sets and then exported it as a function and implemented it into my code.
Training of model:
[trainedClassifier, validationAccuracy] = trainClassifier(training_data);
Classification of new data:
new_data = trainedClassifier.predictFcn(new_data);
Is there a way to extract the chosen NNs for each newly classified data point in addition to the resulting classification from the "trainedClassifier" model?
Since I'm using the existing functions of the App I'm curious on wether such a response is already possible or can at least easily be implemented into the automatically generated classification trainer function code.
Best regards, Michael
Accepted Answer
More Answers (0)
Categories
Find more on Nearest Neighbors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!