Test one instance at Weka

Whether test instances require a class attribute. I used the arff file training set to train the classifier. Now I want to test an instance (and not an arff file, create by code) without a class attribute and predict the class. I found this Weka link : How to get the prediction value in java for a test instance?

But my class attribute is the string "Y" or "N". If valueModelOnce () returns double, what does it mean. This is a class attribute or something else. I am using weka API.

0
source share
1 answer

To test instances, instances must have class labels. Even if you provide class labels, when classifying with a built-in model, Weka does not see the class labels of the test instance. Rather, after testing, it matches whether the prediction about the class of the test instance is correct. If you have shortcuts in the training instances (which you must have), and not on the test instances, then you will receive an error message like "training and testing kits are incompatible." Thanks.

+2
source

Source: https://habr.com/ru/post/1496880/


All Articles