Search in sources :

Example 1 with SMO

use of weka.classifiers.functions.SMO in project dkpro-tc by dkpro.

the class WekaResultsTest method testWekaResultsSingleLabel.

@Test
public void testWekaResultsSingleLabel() throws Exception {
    SMO cl = new SMO();
    Instances testData = WekaUtils.makeOutcomeClassesCompatible(singleLabelTrainData, singleLabelTestData, false);
    Instances trainData = WekaUtils.removeInstanceId(singleLabelTrainData, false);
    testData = WekaUtils.removeInstanceId(testData, false);
    cl.buildClassifier(trainData);
    Evaluation eval = WekaUtils.getEvaluationSinglelabel(cl, trainData, testData);
    assertEquals(7.0, eval.correct(), 0.01);
}
Also used : Instances(weka.core.Instances) Evaluation(weka.classifiers.Evaluation) SMO(weka.classifiers.functions.SMO) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Evaluation (weka.classifiers.Evaluation)1 SMO (weka.classifiers.functions.SMO)1 Instances (weka.core.Instances)1