Example usage for weka.attributeSelection ConsistencySubsetEval buildEvaluator

List of usage examples for weka.attributeSelection ConsistencySubsetEval buildEvaluator

Introduction

In this page you can find the example usage for weka.attributeSelection ConsistencySubsetEval buildEvaluator.

Prototype

@Override
public void buildEvaluator(Instances data) throws Exception 

Source Link

Document

Generates a attribute evaluator.

Usage

From source file:com.rapidminer.operator.validation.ConsistencyFeatureSetEvaluator.java

License:Open Source License

public IOObject[] apply() throws OperatorException {
    ExampleSet exampleSet = getInput(ExampleSet.class);
    Instances instances = WekaTools.toWekaInstances(exampleSet, "TempInstances", WekaInstancesAdaptor.LEARNING);
    double performance = 0.0d;
    try {// www . j  av a2s. c  om
        ConsistencySubsetEval evaluator = new ConsistencySubsetEval();
        evaluator.buildEvaluator(instances);
        BitSet bitSet = new BitSet(exampleSet.getAttributes().size());
        bitSet.flip(0, exampleSet.getAttributes().size());
        performance = evaluator.evaluateSubset(bitSet);
    } catch (Exception e) {
        throw new UserError(this, e, 905, new Object[] { "ConsistencySubsetEval", e.getMessage() });
    }
    PerformanceVector result = new PerformanceVector();
    result.addCriterion(new EstimatedPerformance("ConsistencyFS", performance, 1, false));
    return new IOObject[] { result };
}