K Nearest Neighbor Node, How do I test or apply target attribute that only exists in training set and not in test set?

Hi,
There are two datasets, one - training set, with the target attribute and another - test set without the target attribute. If I’m not mistaken, the first port (0) is used for training data, and the second (1) is used for test data. Though the scorer is not able to produce the target attribute as the first column, with the second being the KNN class. Am I mistaken and going about this the wrong way?
Here is my current workflow


Thanks

Welcome @Ukles

Are you sure your KNN Classifier produces an output table. Right mouse click on the output port (Classified Data). And if so are the columns you need: actual and predicted in this data table?

gr
Hans

1 Like

Hi,
Thank you for the quick reply. In the configuration for KNN node, I have set it to the attribute found in the training set, but not the testing set. Within the output port, the predicted class (which I am assuming is Class(knn)) displays, but the original attribute or class (actual) does not appear in the data table. How should I go about this, to also display the actual?
Thanks again

Hi

Ah, now I understand. You need a Cluster node that produces a PMML cluster model that can be used in a Cluster Assigner node. In this example Cluster on KNIME example server it works for a k-means cluster. I don’t know if it works for an KNN Cluster node. cluster

2 Likes

Hi,
I now realise I’ve been trying to score the actual values to the KNN class classifiers, but as they aren’t present in the test data, it can’t measure the accuracy. Hahaha big facepalm moment for myself, even still thanks HansS

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.