Example usage for weka.attributeSelection ExhaustiveSearch ExhaustiveSearch

List of usage examples for weka.attributeSelection ExhaustiveSearch ExhaustiveSearch

Introduction

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

Prototype

public ExhaustiveSearch() 

Source Link

Document

Constructor

Usage

From source file:RunExhaustiveSearch.java

License:Open Source License

protected static void runAttributeSelection(Instances data, int n) throws Exception {
    AttributeSelection attsel = new AttributeSelection();
    CfsSubsetEval cost_function = new CfsSubsetEval(); // CFS cost function.
    ExhaustiveSearch algorithm = new ExhaustiveSearch(); //  ES algorithm.

    cost_function.buildEvaluator(data);/*from  w  w w.  j a v  a2  s. co  m*/

    attsel.setEvaluator(cost_function);
    attsel.setSearch(algorithm);

    attsel.SelectAttributes(data);

    int[] indices = attsel.selectedAttributes();

    System.out.println("Selected features:\n" + Utils.arrayToString(indices));
}