Options

Doubt on results of k-Nearest Neighbors

vyronadvyronad Member Posts: 12 Contributor II
edited November 2018 in Help
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.

Answers

  • Options
    radoneradone RapidMiner Certified Expert, Member Posts: 74 Guru
    Hello Veeranna,
    Does the results change when the seed of a random generator is changed?

    radone
  • Options
    vyronadvyronad Member Posts: 12 Contributor II
    Hello Radone,

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

    Thanks,
    Best,
    Veranna Ronad.
Sign In or Register to comment.