有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何从WEKAAPI计算置信度?

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

双pred=fc。classifyInstance(test.instance(i))

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


共 (1) 个答案

  1. # 1 楼答案

    weka.classifiers.Classifier.distributionForInstance(Instance)

    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)