Weka:如何在java中获取测试实例的预测值? [英] Weka: How do I get the prediction value in java for a test instance?

查看:225
本文介绍了Weka:如何在java中获取测试实例的预测值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功训练了一个分类器(bayesnet)并构建了一个测试集(ARFF格式),它有一个实例,缺少一个值。

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);

如何访问缺失值的预测?我用GUI测试了两种ARFF结构(训练和测试)。他们工作。我根本就不知道,如何访问预测值......

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

推荐答案

你想用 eTest.evaluateModelOnce()这将返回一个double值,预测单个 testInstance evaluateModel()方法适用于多个实例。

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.

这篇关于Weka:如何在java中获取测试实例的预测值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆