ARFS feature selection#
ARFS provides feature selection and preprocessing for pandas data. Start with the offline GrootCV example to fit a selector and reuse it on held-out rows. See Upgrading to 5.0 for migration steps.
Choose a method#
Apply explicit screening rules. Remove columns by missingness, distinct values, cardinality or association. See Screen a table with basic feature selectors.
Quickly screen by model importance. Fit
VariableImportanceto rank predictors from a single LightGBM fit. See Screen a table with basic feature selectors.Look for signals against shuffled controls. Start with GrootCV for regression or classification. Both tutorials compare a downstream model with all features and show Leshy and BoostAGroota. Download the
regression notebookorclassification notebookfrom this build.Keep a fixed feature budget. MRMR balances relevance to the target and redundancy with selected predictors. See MRMR: selection before and after supervised partitioning.
Select terms in an encoded GLM. Lasso selects individual terms and refits the surviving terms without a penalty. See Lasso selection for an encoded GLM.
Change the feature representation. Use
TreeDiscretizerfor numeric bins andTreeGrouperfor categorical groups. See Learn numeric bins and categorical groups.
Selections depend on the training rows, predictor dtypes and encodings, and any model, importance method or observation weights used. Fit learned steps inside each training split and reuse them to transform held-out rows. Use arfs.feature_selection package for signatures and fitted attributes.
User's guide
Core tutorials
Advanced tutorials
- MRMR versus ARFS all-relevant selection
- Categorical predictors and estimator inputs
- How redundant predictors change importance
- GrootCV objectives, boosting limits and custom splits
- Feature selection in time-series evaluation
- Bound row sampling before feature selection
- Poisson loss and exposure weights