Effacer les filtres
Effacer les filtres

how to find distance matrix using knnclassify in matlab?

2 vues (au cours des 30 derniers jours)
Sahar abdalah
Sahar abdalah le 9 Avr 2015
Commenté : Star Strider le 9 Avr 2015
I work in image classication and I used two classifiers : svm et knn. the problem is that the knnclassify matlab function allows only return a list of labels test images (class) and I need to get out the distance matrix
class = knnclassify( TestData , TrainData , TrainLabels);
please help me how can I find the distance matrix ?? and thanks in advance

Réponse acceptée

Star Strider
Star Strider le 9 Avr 2015
You likely have to use knnsearch to get the distances. See the documentation on Classification Using Nearest Neighbors for details.
  4 commentaires
Sahar abdalah
Sahar abdalah le 9 Avr 2015
thank you, that's exactly the answer
Star Strider
Star Strider le 9 Avr 2015
My pleasure! I’m glad it worked.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by