Search in sources :

Example 1 with BR

use of meka.classifiers.multilabel.BR in project dkpro-tc by dkpro.

the class WekaResultsTest method testWekaResultsMultiLabel.

@Test
public void testWekaResultsMultiLabel() throws Exception {
    BR cl = new BR();
    cl.setOptions(new String[] { "-W", J48.class.getName() });
    Instances testData = WekaUtils.makeOutcomeClassesCompatible(multiLabelTrainData, multiLabelTestData, true);
    Instances trainData = WekaUtils.removeInstanceId(multiLabelTrainData, true);
    testData = WekaUtils.removeInstanceId(testData, true);
    cl.buildClassifier(trainData);
    Result eval = WekaUtils.getEvaluationMultilabel(cl, trainData, testData, "0.2");
    assertEquals(16.0, eval.L, 0.01);
    assertEquals(0.0, (Double) Result.getStats(eval, "1").get("Exact match"), 0.01);
}
Also used : BR(meka.classifiers.multilabel.BR) Instances(weka.core.Instances) J48(weka.classifiers.trees.J48) Result(meka.core.Result) Test(org.junit.Test)

Aggregations

BR (meka.classifiers.multilabel.BR)1 Result (meka.core.Result)1 Test (org.junit.Test)1 J48 (weka.classifiers.trees.J48)1 Instances (weka.core.Instances)1