Feature selection chooses model inputs. Compare filters, wrappers and embedded methods, and see why selection must be fitted inside chronological training folds.
Feature selection
Feature selection chooses a subset of the available input variables for a model. A return forecast might retain lagged returns and spread measures while dropping other candidates. The aim may be simpler estimation, lower data costs or better predictions on new observations. Keeping fewer inputs can help, but does not by itself establish a trading edge.
Selection preserves chosen features. Feature engineering constructs or transforms inputs; principal component analysis, for example, produces combinations of inputs rather than choosing original columns. These operations can appear in the same pipeline.
Three ways to choose
Approach
What drives the choice?
Main caution
Filter
A statistic computed before fitting the final predictor, such as training-sample variance or each feature's association with the target.
Separate rankings can miss useful interactions and retain redundant inputs. A filter need not use targets.
Wrapper
Repeatedly fit and compare predictive models with different subsets; forward selection is one example.
The search can be expensive and can overfit its selection criterion.
Embedded
Selection occurs through the model-fitting objective itself; Lasso regression can set coefficients exactly to zero.
The chosen subset depends on the model, penalty and data. A zero coefficient does not prove economic irrelevance.
The scikit-learn feature-selection guide describes variance filters, univariate scores, sequential selection and sparse-model selection. No method has a universal advantage. A feature that is weak alone can contribute jointly, and strongly related features can substitute for one another. Investigate predictive performance and selection stability within development data rather than treating one ranking as permanent truth.
Five candidates, two retained
Consider a fictional forecasting pipeline with five candidate features, labelled A through E. Every input is constructed from information available before its forecast decision. For one chronological training fold, suppose the fitted selector retains A and C. The predictor is fitted using those columns; the later validation block uses the same fitted transformation.
The count is simply
5−2=3 features removed.
This is a stipulated mask, not an empirical finding that A and C are best. It gives no numerical information gain, improvement in forecast accuracy or fraction of causal drivers discovered. Removing three columns can leave predictive information almost unchanged, discard valuable structure or improve estimation by reducing noise.
An illustrative selector fitted within an earlier training fold retains A and C from five candidate features and removes B, D and E. Later validation applies the fitted mask. Freeze the complete procedure before the final test; test scores must not choose the columns.
Original synthetic design. Counts describe columns only; A and C are illustrative choices. An inner subset search stays inside the training fold being evaluated.
Repeat selection inside each training fold. The retained names may change as the eligible training history changes. Selecting once on the complete history and then cross-validating only the predictor leaks information across folds. The official leakage example demonstrates this failure even when the targets are random.
If the method or number retained is tuned, use chronological inner validation within the training portion, then assess the chosen procedure on the outer later block. Each inner split must refit the selector using only its own training portion. Wrapper searches need the same separation between the data used to choose subsets and the data used to assess the resulting procedure.
The boundary is the decision, not the file name
Before opening a final test, freeze the candidate universe, selection rule, preprocessing, metric and refitting schedule. An adaptive procedure may reselect features later if that update rule was specified beforehand and uses only information then available. Choosing columns because their final-test results look attractive makes that test part of development—even if no test row enters the regression fit. It is a form of overfitting through research choices.
Chronological splits also need an information audit. An accounting variable belongs to the information set only after its usable release, not at the end of the accounting period. Supervised selection cannot use training targets whose outcomes are unfinished at the fit cutoff. Where labels share future return intervals across a split, remove conflicting training observations before fitting the selector. An arbitrary time gap does not automatically solve every overlap or availability problem.
Finally, selection is a predictive modelling decision, not a causal explanation. A retained variable can proxy another economic exposure, exploit an unstable relationship or be useful only with particular companions. A smaller feature set still needs evaluation against a sensible baseline, uncertainty analysis and, for a trading application, realistic transaction costs.
Check the pipeline
A researcher selects columns using all development targets, then runs chronological cross-validation with a fresh predictor in each training fold. The final test has not been opened. Are those cross-validation scores a clean assessment of the complete selection procedure?
Answer. No. Labels in the held-out development blocks have already influenced the shared column choice. Refitting only the predictor does not remove that influence. Put selection inside every training fold, including any inner tuning splits. Keeping the final test unopened preserves a separate source of later evidence, but does not repair the contaminated development scores.
Sources
James, G., Witten, D., Hastie, T., Tibshirani, R. and Taylor, J. (2023), An Introduction to Statistical Learning: with Applications in Python, §§6.1.1–6.1.3, pp. 231–236, and §6.2.2, p. 244. Subset search, model-size assessment and Lasso sparsity; local text consulted. The authors provide the book through their official site.
scikit-learn developers, Feature selection, §§1.13.1–1.13.6. Official method and pipeline documentation.
López de Prado, M. (2018), Advances in Financial Machine Learning, §§7.4.1–7.4.3. Local text consulted for overlapping-label exclusions. The count example and diagram here are original and synthetic.