如何计算weka API的置信度? [英] how to calculate confidence from weka API?

查看:147
本文介绍了如何计算weka API的置信度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用weka java API,我可以在训练集训练后得到预测的类标签。

I am using the weka java API, I can get the predicted class label after training on the training set.

double pred = fc.classifyInstance(test.instance (i));

double pred = fc.classifyInstance(test.instance(i));

但我想知道类标签的置信概率,我应该使用什么函数?
在GUI中,我可以选择输出预测为txt文件,并且可以轻松获得概率,但我想知道如何通过代码。
我使用的是J48()分类器。

But I want to know the confidence probability of the class label, what function should I use ? In the GUI I can select the output prediction to a txt file and can get the probability easily, but I want to know how to get through the code. I am using J48() classifier.

推荐答案

weka.classifiers.Classifier.distributionForInstance (实例)


预测给定实例的类成员资格。如果实例未分类,则返回的数组元素必须全为零。如果类是数字,则数组必须只包含一个元素,该元素包含预测值。请注意,分类器必须实现this或classifyInstance()。

Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero. If the class is numeric, the array must consist of only one element, which contains the predicted value. Note that a classifier MUST implement either this or classifyInstance().

(来源:JavaDoc)。

(source: JavaDoc).

这篇关于如何计算weka API的置信度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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