Example usage for weka.attributeSelection ConsistencySubsetEval evaluateSubset

List of usage examples for weka.attributeSelection ConsistencySubsetEval evaluateSubset

Introduction

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

Prototype

@Override
public double evaluateSubset(BitSet subset) throws Exception 

Source Link

Document

Evaluates a subset of attributes

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 {//  w w  w  .  j  av a2  s  .c  o m
        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 };
}