List of usage examples for weka.attributeSelection ExhaustiveSearch ExhaustiveSearch
public ExhaustiveSearch()
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)); }