Releases: lhallee/featureranker
Releases · lhallee/featureranker
Release list
v3.0.4
Added
- Split-aware Hub loading:
get_hf_datanow resolves a dataset's own validation (validation/valid/val/dev) andtestsplits automatically (valid_split/test_split, "auto" by default; name explicitly or disable with None). When extra splits exist the return is aDataSplitswhose frames were cleaned and encoded jointly, so feature columns always match across splits (a category seen only in test still gets its sub-feature everywhere); rows are cleaned per split andn_rowssamples train only. - Held-out evaluation for convex fits:
fit_convexandRankingResult.fit_convexacceptvalid=(X, y)andtest=(X, y)pairs they never train on (e.g.splits.valid,splits.test). Eval targets are encoded with the fitting target's class mapping; unseen labels raise. Best practice: fit on train, choose settings on valid, quote test.
Changed
ConvexFit.metricsreports the AUC/R2 per split ("train", plus "valid"/"test" when given);metric_valuebecame a property over it andmethod_metricsnow maps each selection to its per-split metrics.get_datakeeps the original row index of surviving rows instead of resetting it.
v3.0.3
Added
- Maximum-entropy smoothing for convex fits:
fit_convexandRankingResult.fit_convexgainentropy(default 0.1), which addsentropy * Var(y) * sum(w * log w)to the simplex least-squares objective. The entropy gradient diverges at the simplex boundary, so the optimum is strictly interior: every weight stays strictly positive, and the fit is unique even when features duplicate each other (near-duplicates split the weight symmetrically instead of one arbitrarily taking it all). Scaling byVar(y)makes the strength invariant to target units.entropy=0recovers plain least squares, where redundant features get exact zero weights.
v3.0.2
Added
- Glob column drops:
columns_to_dropaccepts patterns alongside exact names —"target_*"drops every matching column. A pattern never drops the target itself, and a pattern matching nothing raises to catch typos. Works inget_dataandget_hf_data. - Probe metrics:
feature_ranking(probe=True)(the default) evaluates every method's ranking with a shared cross-validated linear probe (standardized logistic regression or ridge, 3-fold, top-k cuts 1-64, at most 10,000 seeded rows). Per-method reports land indiagnostics[method]["probe"]andresult.probe_table(). - Auto-tuned vote weights:
voting(result, weights="auto")weights each method by its probe skill, so more predictive methods vote harder; all-at-chance falls back to equal weights. - Per-method convex metrics:
RankingResult.fit_convexfillsConvexFit.method_metricswith the fit metric recomputed on each ranking method's own top_n selection beside the returned "ensemble" fit.
Changed
fit_convexclamps atop_nabove the feature count to all features instead of raising, so a fixed NUM_KEEP works across datasets of any width.
v3.0.1
Added
- Hugging Face Hub integration:
get_hf_datadownloads a Hub dataset split, converts it to pandas, and returns ranking-ready(X, y)given the label column and columns to exclude;load_hf_datasetreturns the raw DataFrame;hf_loginauthenticates for private or gated datasets.datasets >= 2.19joins the required dependencies. - Convex combination fitting:
RankingResult.fit_convex(X, y, top_n=...)fits the optimal weights >= 0 summing to one over the top consensus features (a deterministic convex quadratic program), and the standalonefit_convexfits every column of X. Features are z-scored internally by default (standardize=Falsefits the raw values). Both return aConvexFitwith aligned weights, an R2 or ROC AUC fit metric,predict, andtable. get_datagainedencodingandmax_categoriesparameters.
Changed
get_datanow one-hot encodes categorical feature columns by default: each unique value becomes a 0/1 sub-feature named"{column}-{value}"(color-bluefor strings,color-0for integer categories), injected at the parent column's position. Columns with more thanmax_categoriesunique values (default 64) fall back to label encoding, andencoding="label"restores the previous behavior. Booleans stay single 0/1 columns.
v3.0.0
Breaking release: the ranking engine, public API, packaging, and docs were rebuilt. Full details in CHANGELOG.md and the v2 to v3 migration guide.
Highlights
- Correct L1 classification rankings. v2 recorded the wrong end of the regularization path (scores collapsed to ties), crashed on 3+ classes, and was nondeterministic. v3 finds each feature's true entry point with parallel coarse-to-fine C waves: 236.6s to 8.3s on 20k x 500, and deterministic at any n_jobs.
- Adaptive L1 regression paths: exact Gram-based LARS breakpoints when affordable, dense warm-started coordinate descent otherwise.
- Halving hyperparameter search for the tree models (27 candidates on subsampled rungs) with exactly one final full-data fit.
- Typed results:
feature_rankingreturns a frozenRankingResult(rankings dict, rank/score matrices, diagnostics, save/load); per-method options dataclasses replace silent kwargs;ValueErrorcontract throughout. - Any numeric feature matrix: pass a bare 2D numpy array (embeddings, pooled hidden states) and features get stable generated IDs. The ModernBERT sentiment example ranks 1,536 unnamed transformer dimensions; its top 20 keep 96.7% of full-representation probe accuracy and beat PCA, UMAP, and t-SNE at matched dimensionality.
- Redesigned plots (consensus dot plot, rank heatmap, emphasis vote bars) and a docs/ reference set with self-regenerating examples.
- Floors: Python >= 3.11, scikit-learn >= 1.8, xgboost >= 2.0. License is now MIT.
🤖 Generated with Claude Code