Repository navigation
FeatRanker 1.21.1
First release on GitHub since 0.4.1. It carries every version from 0.5 to 1.21.1 (most of which were never published separately). Full per-version notes are in the docs; highlights below.
pip install -U featranker
pip install -U "featranker[all,shap,plot]" # XGBoost, CatBoost, SHAP evidence, plots
Requires Python ≥ 3.10 and scikit-learn ≥ 1.5.
Highlights since 0.4.1
Ranking you can trust
- Family-aware consensus: each model family casts one vote;
families=groups your own models. - Resampled ranking (
rank_resampled) with per-split stability. - Shadow features: per-family shares, a binomial hits test with BH q-values (labelled uncalibrated), and a check that every model actually keeps the shadow columns (nested
ColumnTransformers, selectors, unions, meta-estimators). - Dummy-baseline gate, structured failures, and a
runblock that fingerprints data, labels, weights and splits.
Using the answer
ConsensusSelector: a scikit-learn selector, safe inside nested cross-validation.ablate(): refit on the top-k groups and score each k, with provenance and a paired curve.summarize()findings,Report.plot(),to_frame().- Evidence: train score, overfit gap, correlated groups, SHAP for linear and tree models.
Real-world data
- Missing values (
missing="impute"), categorical columns (categorical=[...]or"auto"), named model input (model_input="dataframe"), sample weights end to end. - Grouped or time-ordered rows:
shuffle="within_groups"/"circular", with a warning for groups that cannot be measured that way. - Multiple scorers with shared predictions.
- Large data:
max_samples(scoring),fit(max_samples=)(training),max_categories(one-hot cap); lower memory peaks for shadows and correlations.
CLI: featranker --train-data … --eval-data … --target … --scoring …, plus --drop, --ablate, --categorical, --missing, --sample-weight, --max-categories, --max-train-samples.
1.21.1 fixes
- Shadow check marks models unverified when a selector,
FeatureUnionorColumnTransformerfollows an untracked step or sits inside a meta-estimator. - Prediction sharing only for scikit-learn's own scorer class; custom subclasses are called directly.
ablate()checks training rows in both directions.- Consistent fingerprint scheme for shuffle labels in old pickles; Spearman keeps float32 ranks on newer SciPy.
- Resampled
constant_within_groupsfinding names the affected splits. - Compatibility with scikit-learn 1.9 and Python 3.10 in the test suite.
Upgrading from 0.4.1
- scikit-learn ≥ 1.5 is required.
- The
lightgbmextra was removed (no built-in model used it);allinstalls XGBoost and CatBoost. explain()andto_prompt()are deprecated (removal in 2.0).rank_features()returns aReport, adictsubclass; dict use is unchanged.- Report fingerprints of integer and boolean data changed in 1.17 (lossless hashing); compare runs within the same scheme (
run.fingerprint_scheme).
Known limitations
- The shadow hits test is not calibrated for arbitrary estimators or overlapping splits.
- SHAP evidence covers linear and tree models only.
- Custom transformers that drop columns (other than selectors) are assumed to use every column by the shadow check.
- The calibration and benchmark studies predate 1.17.
Docs: Usage · Report · API and stability