Feature selection reduces the dimensionality of data by selecting only a subset of measured features (predictor variables) to create a model. Selection criteria usually involve the minimization of a specific measure of predictive error for models fit to different subsets. Algorithms search for a subset of predictors that optimally model measured responses, subject to constraints such as required or excluded features and the size of the subset.
Feature selection is preferable to feature transformation when the original units and meaning of features are important and the modeling goal is to identify an influential subset. When categorical features are present, and numerical transformations are inappropriate, feature selection becomes the primary means of dimension reduction.
An objective function, called the criterion, which the method seeks to minimize over all feasible feature subsets. Common criteria are mean squared error (for regression models) and misclassification rate (for classification models).
A sequential search algorithm, which adds or removes features from a candidate subset while evaluating the criterion. Since an exhaustive comparison of the criterion value at all 2n subsets of an n-feature data set is typically infeasible (depending on the size of n and the cost of objective calls), sequential searches move in only one direction, always growing or always shrinking the candidate set.
The method has two variants:
Stepwise regression is a sequential feature selection technique
designed specifically for least-squares fitting. The functions
use of optimizations that are only possible with least-squares criteria.
Unlike generalized sequential feature selection, stepwise regression
may remove features that have been added or add features that have
The Statistics and Machine Learning Toolbox™ function
sequentialfs carries out sequential feature
selection. Input arguments include predictor and response data and
a function handle to a file implementing the criterion function. Optional
inputs allow you to specify SFS or SBS, required or excluded features,
and the size of the feature subset. The function calls
evaluate the criterion at different candidate sets.