With candidate features, how many models does best-subset selection have to consider, and how many model fits does forward stepwise selection need? What changes for , and why might forward stepwise still give a worse model than best subset?
Supervised learning, Subset selection
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you know the cost of best subset (exponential) against the greedy search (quadratic), and the price paid for being greedy.
Key idea
Best subset has candidate models. Forward stepwise considers candidates (plus the null model), but never revisits a choice.
Steps
- Each feature is in or out of the model, so best subset considers subsets: and .
- Forward stepwise starts from the intercept-only model. At step it tries each of the unused features and adds the best. Total fits (56 with the null model). For it is (466).
- So forward stepwise scales as against , and is usable when is in the hundreds or thousands. Backward elimination needs to fit the full model first.
- Greedy can be worse: a feature that is weak alone but strong together with another (for example two features whose difference matters) is never added first. Best subset finds such pairs.
- Always choose the model size by cross-validation or an information criterion, not by training RSS, which always falls as features are added.
Common mistakes
- Counting or for best subset.
- Choosing the model size by training error. It always favours the largest model.
- Saying forward stepwise always finds the best subset of each size. It does not.
How long your answer should be
4–6 sentences with the three counts.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: An Adaline has two weights, no bias, starting at , with learning rate and the delta rule . Apply it to the sample with target , then to with target . What are the weights after each step? For what range of is a single repeated sample stable?
Next in Supervised learning: A three-class softmax model produces scores (logits) for an input. Compute the class probabilities. If the true class is class 2, what is the cross-entropy loss, and what is the gradient of the loss with respect to ?