KNN Classification

ShubhaShubha MemberPosts:139Guru
edited November 2019 inHelp
Hi,

I run the below code given in the sample XML files (04_NearestNeighbours.XML) for the KNN Classification.










But the result I get is a blank KNNClassification model with the contents,
KNNClassification

KNNClassification (prediction model for label class)
and an id attribute added into the Exampleset.

Why are the results not displayed?

Thanks,
Shubha

Answers

  • keithkeith MemberPosts:157Guru
    You created a model, but did not apply it to the dataset. Applying the model is what generates predictions. You need to add a ModelApplier node after creating the model. ry this instead:
















  • ShubhaShubha MemberPosts:139Guru
    Thank you very much Keith... It helped.

    I have one single question... Dont we get any 'values' like estimate values or any any distance values in the model? Because i just see the below in the model.
    KNNClassification
    KNNClassification (prediction model for label class)
    Thanks,Shubha
  • keithkeith MemberPosts:157Guru
    KNN is a "lazy" learner. It doesn't compute anything when it builds the model. It just saves the examples as reference points so that the nearest neighbors can be computed later when applied to other data. There are no distance computations, and the coordinates of the examples in the multidimensional space are just the attribute values of the examples.

    In other words, there really isn't anything to show when the model is created, since all the heavy lifting is done at prediction time.

Sign InorRegisterto comment.