Azzera filtri
Azzera filtri

How to use knn classifier properly in this case

1 visualizzazione (ultimi 30 giorni)
Nico S
Nico S il 26 Gen 2016
Risposto: Walter Roberson il 26 Gen 2016
Im extracting features from some signal so i can use them as input for k nearest neighbor i already did some search about using knn to classify, some post suggested using matlab function
class = knnclassify(Sample,Training,Group,k,distance,rule)
for example: i have 2 array of extracted signal features. i use one as sample, and the other one as training sample = sampleFeatures(500x14) training = trainingFeatures(700x14)
i use them like this:
Class = knnclassify(sampleFeatures,trainingFeatures,Group,5,'euclidean','nearest');
what i want to know is, is this the right way to classify my data using knn. is there any other knn code in matlab which is far better than this one? maybe like more powerful one ill really appreciate it if someone can provide some useful link about knn classifier in matlab
thanks in advance sorry im new to this

Risposte (1)

Walter Roberson
Walter Roberson il 26 Gen 2016
No, knnclassify() is as powerful as knn gets, other than the fact that it does not have the ability to put in your own distance measure.

Community Treasure Hunt

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

Start Hunting!

Translated by