Example usage for weka.core Capabilities testWithFail

List of usage examples for weka.core Capabilities testWithFail

Introduction

In this page you can find the example usage for weka.core Capabilities testWithFail.

Prototype

public void testWithFail(Attribute att, boolean isClass) throws Exception 

Source Link

Document

tests the given attribute by calling the test(Attribute,boolean) method and throws an exception if the test fails.

Usage

From source file:meka.classifiers.multilabel.AbstractMultiLabelClassifier.java

License:Open Source License

/**
 * TestCapabilities./*from  ww w .  j  av a2s .  co m*/
 * Make sure the training data is suitable.
 * @param D   the data
 */
public void testCapabilities(Instances D) throws Exception {
    // get the classifier's capabilities, enable all class attributes and do the usual test
    Capabilities cap = getCapabilities();
    cap.enableAllClasses();
    //getCapabilities().testWithFail(D);
    // get the capabilities again, test class attributes individually
    int L = D.classIndex();
    for (int j = 0; j < L; j++) {
        Attribute c = D.attribute(j);
        cap.testWithFail(c, true);
    }
}