您好,我是使用 MOA 和 WEKA 的新手,
我需要使用此代码测试配对学习者的概念,并且我已经能够找到代码,但我在网上找不到任何示例,我很难弄清楚如何将我的数据传递到代码中并运行测试并查看我的结果. 请任何人指出我正确的方向或给我一些我可以遵循的指示来实现这一点。
moa/moa/src/main/java/moa/classifiers/meta/PairedLearners.java
尝试使用类似的代码: https ://groups.google.com/forum/#!topic/moa-development/3IKcguR2kOk
此致。//下面的示例代码
import moa.classifiers.meta.pairedLearner;
Public class SamplePairedlearner{
public static void main(String[] args) {
FileStream fStream = new FileStream();
fStream.arffFileOption.setValue("test.arff");// set the ARFF file name
fStream.normalizeOption.setValue(false);// set normalized to be true or false
fStream.prepareForUse();
int numLines = 0;
PairedLearner learners = PairedLearners();
learners.resetLearning();
learners.resetLearningImpl(); //this is where i get an error message
ClusteringStream stream = fStream;
while (stream.hasMoreInstances()) {
Instance curr = stream.nextInstance().getData();
learners.trainOnInstanceImpl(curr)//this line also generates an error
numLines++;
}
Clustering resDstream = dstream.getClusteringResult();
dstream.getMicroClusteringResult();
System.out.println("Size of result from Dstream: " + resDstream.size());
System.out.println(numLines + " lines have been read");
}
}