Ensemble feature ranking

The ensemble feature ranking algorithm is another form of feature ranking and as such provides the following method to determine the rank of a feature. Lower ranks are better.

  1. public int rank(int attIndex);

The method will return the rank of the feature with the provided index.
Typical usage of an ensemble feature ranking algorithm is very similar to the use of a single feature ranking algorithm.
  1. /* Load the iris data set */
  2. Dataset data = FileHandler.loadDataset(new File("devtools/data/iris.data"), 4, ",");
  3. /* Create a feature ranking algorithm */
  4. RecursiveFeatureEliminationSVM[] svmrfes = new RecursiveFeatureEliminationSVM[10];
  5. for (int i = 0; i < svmrfes.length; i++)
  6. svmrfes[i] = new RecursiveFeatureEliminationSVM(0.2);
  7. LinearRankingEnsemble ensemble = new LinearRankingEnsemble(svmrfes);
  8. /* Build the ensemble */
  9. ensemble.build(data);
  10. /* Get rank of i-th feature */
  11. int rank=ensemble.rank(i)

[Documented source code]