简体   繁体   中英

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

I have successfully trained a classifier (bayesnet) and constructed a test set (ARFF-format), which has one instance, with one missing value.

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

How can I access the prediction for the missing value? I have tested both ARFF structures (training & Test) with the GUI. They work. I simply do not know, how to access the prediction value...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM