Subset selection algorithms differ with the scoring and ranking methods in that they only provide a set of features that are selected without further information on the quality of each feature individually.
Subset selection algorithms provide the method
- public Set<Integer> selectedAttributes();
The basic use of a feature subset selection algorithm is depicted in the snippet below.
- /* Load the iris data set */
- Dataset data = FileHandler.loadDataset(new File("iris.data"), 4, ",");
- /* Construct a greedy forward subset selector */
- GreedyForwardSelection ga = new GreedyForwardSelection(1, new PearsonCorrelationCoefficient());
- /* Apply the algorithm to the data set */
- /* Print out the attribute that has been selected */