Doubt on results of k-Nearest Neighbors

vyronad
vyronad New Altair Community Member
edited November 5 in Community Q&A
Hi All,

I am running "04_NearestNeighbors" sample process (I have set k=2), the results show as below.

----------------------------------------------------
KNNClassification
2-Nearest Neighbour model for classification. The model contains 150 examples with 4 dimensions of the following classes: 
Iris-setosa 
Iris-versicolor 
Iris-virginica
----------------------------------------------------

In-spite of setting k=2, it is not classifying category into two. Whatever number is assigned to k, the result remains same. Is there separate configuration for this algorithm?

Because as per the algorithm (http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm), it has to classify the items based on the distance.

Kindly clarify.

Thanks,
Best,
Veeranna Ronad.
Tagged:

Answers

  • radone
    radone New Altair Community Member
    Hello Veeranna,
    Does the results change when the seed of a random generator is changed?

    radone
  • vyronad
    vyronad New Altair Community Member
    Hello Radone,

    I hope "seed of a random generator" means the value of 'k'. Yes, the result is not changing.

    Thanks,
    Best,
    Veranna Ronad.