Question about KNN and how to use it.
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I need to use KNN in matlab to find some results.
I have data in .mat that has this kind of information(training data)
1|232|34|21|542|
2|32|333|542|32|
and so on.
Then i have a second information that i will gather thro the aplication but i will only get let say
a=10|343|543|43|23
So now my question is do i only need to do is something like this http://www.mathworks.com/help/toolbox/stats/classificationknnclass.html
Best regards.
4 Commenti
Walter Roberson
il 1 Set 2012
Your question does not contain enough information to be answered.
What does "a" represent? Is it the "response", one entry per row of your training data?
You ask if you only need to apply a particular routine, but you do not indicate what you are trying to do, what your desired outcome is.
Risposta accettata
Ilya
il 4 Set 2012
Modificato: Ilya
il 4 Set 2012
Take a look at the User Guide for k-NN classification: http://www.mathworks.com/help/toolbox/stats/bsehyju-1.html
In your case, the fruit code would be the class label Y and the 3 RGB numbers and roundness would be predictors X.
If you are stuck, follow up with a specific question.
9 Commenti
Ilya
il 9 Set 2012
The k-NN classifier does not compute cluster centroids. An observation is classified to the class most popular among its k neighbors found in the training data. You can code a simple implementation of the k-NN classifier using knnsearch or pdist2 functions from Statistics Tlbx.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!