gpt4 book ai didi

machine-learning - 在 Weka 中创建一个未标记的实例,而不使用 DenseInstance 类

转载 作者:行者123 更新时间:2023-11-30 09:57:11 25 4
gpt4 key购买 nike

我有以下方法,我需要一个新的未标记实例。我有最新的 weka.jar 文件,但它没有 DenseInstance 类。那么如何创建这样的实例呢?

public static void main(String[] args) throws Exception {
BufferedReader datafile = readDataFile("ads.txt");

Instances data = new Instances(datafile);
data.setClassIndex(data.numAttributes() - 1);

Classifier ibk = new IBk();
ibk.buildClassifier(data);

// here need a new unlabeled instance
double classif = ibk.classifyInstance(data.firstInstance());
System.out.println(classif);
}

最佳答案

您确定拥有最新版本的 weka.jar 文件吗? Weka 3.6 没有在安装目录中提供带有 DenseInstance 类的 weka.jar 文件,3.7(开发者版本)提供了。

关于machine-learning - 在 Weka 中创建一个未标记的实例,而不使用 DenseInstance 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21421015/

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