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

混江龙づ霸主 提交于 2019-12-31 07:14:19

问题


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...


回答1:


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.



来源:https://stackoverflow.com/questions/8957926/weka-how-do-i-get-the-prediction-value-in-java-for-a-test-instance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!