Weka: How to get the prediction value in java for a test instance?

I successfully trained the classifier (bayesnet) and built a test suite (ARFF format) that has one instance with one missing value.

Evaluation eTest = new Evaluation(trainingInstance); eTest.evaluateModel(bayes_Classifier, testInstance); 

How can I access the prediction for a missing value? I tested both ARFF structures (training and testing) with a graphical interface. They work. I just don't know how to access the prediction value ...

0
source share
1 answer

You want to use eTest.evaluateModelOnce() , which will return a double value, prediction for a single testInstance . The evaluateModel() method is designed for multiple instances.

+1
source

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


All Articles