gpt4 book ai didi

java - 如何从 weka API 计算置信度?

转载 作者:行者123 更新时间:2023-11-29 08:52:45 29 4
gpt4 key购买 nike

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

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

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

最佳答案

weka.classifiers.Classifier.distributionForInstance(实例)

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

关于java - 如何从 weka API 计算置信度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21902473/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com