我不明白为什么 Weka 评估类构造函数需要训练实例才能工作。
谁能解释一下?
理论上,评估仅取决于训练模型(下一个代码中的cls)和测试数据(TestingSet)。
谢谢!
这是一个例子:
// TrainingSet is the training Instances
// TestingSet is the testingInstances
// Build de classifier
Classifier cls = (Classifier) new NaiveBayes();
cls.buildClassifier(TrainingSet);
// Test the model
Evaluation eTest = new Evaluation(**TrainingSet**);
eTest.evaluateModel(cls, TestingSet);
最佳答案
来自 UMass Boston Computer Science Documentation on Weka :
Evaluation public Evaluation(Instances data) throws java.lang.Exception
Initializes all the counters for the evaluation.
Parameters:
data - set of training instances, to get some header information and prior class distribution information
Throws:
java.lang.Exception - if the class is not defined
可以看看构造函数源码here .
关于java - 为什么 WEKA 评估类需要训练实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32605249/