/** * <summary> The backward method starts with all the features and removes the least significant feature at each iteration.</summary> * * <param name="currentSubSetList">List to add the FeatureSubsets.</param> * <param name="current"> FeatureSubset that will be added to currentSubSetList</param> */ protected void Backward(List <FeatureSubSet> currentSubSetList, FeatureSubSet current) { for (var i = 0; i < current.Size(); i++) { var candidate = (FeatureSubSet)current.Clone(); candidate.Remove(i); currentSubSetList.Add(candidate); } }
/** * <summary> The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.</summary> * * <param name="currentSubSetList">List to add the FeatureSubsets.</param> * <param name="current"> FeatureSubset that will be added to currentSubSetList.</param> * <param name="numberOfFeatures"> The number of features to add the subset.</param> */ protected void Forward(List <FeatureSubSet> currentSubSetList, FeatureSubSet current, int numberOfFeatures) { for (var i = 0; i < numberOfFeatures; i++) { if (!current.Contains(i)) { var candidate = (FeatureSubSet)current.Clone(); candidate.Add(i); currentSubSetList.Add(candidate); } } }