First release. Unifies the feature_selection script collection into a package
with 16 exported functions sharing one calling convention and one return type.
All selection functions take the form:
fs_<method>(data, target, ..., seed = NULL, verbose = FALSE, n_cores = 1L)data is always first and target (a single column-name string) always second.
This replaces the previous mix of response_col, target_var, target_col,
responseName, response_var, dependent_var, and x/y argument pairs.
Other renames: p -> train_ratio, predictor_cols -> predictors,
out -> output, log_progress/show_progress/doTrace -> verbose,
cores/temp_multisession -> n_cores, and control$split_ratio ->
control$train_ratio in fs_randomforest(). fs_randomforest() also moves
seed and n_cores out of its control list into real arguments.
Removed arguments that never worked or had no effect: early_stop_threshold
(fs_bayes()), early_stop and feature_funcs (fs_recursivefeature(),
the latter now passed as rfe_control$functions), seed and return_models
(fs_stepwise()), memoise_result (fs_svd()), auto_install
(fs_randomforest()), and method (fs_mars(), which is earth-only).
The 14 selection functions return an fs_result object with selected,
scores, method, task, model, details, and call, plus print(),
summary(), and selected() methods. Method-specific output moved into
details. fs_pca() and fs_svd() are dimensionality reduction and keep
their own decomposition structure.
fs_svm()gained a real SVM-RFE implementation (linear-kernel weight-vector ranking with a refit at each elimination step, plus cross-validated size selection). The previous behavior — random-forest RFE — is still available viaselect_method = "rf_rfe".fs_correlation()gainedprune(defaultTRUE):selectedis now the reduced non-redundant set rather than both members of every correlated pair.fs_boruta()prunes correlated features by Boruta importance, keeping the stronger member of a correlated group instead of deferring to a blind correlation heuristic.fs_bayes()selects withloo::loo_compare()and a 1-SE parsimony rule (rule = "1se", default) instead of the raw elpd maximum. The rule accepts either containerloo_compare()may return (matrix or data.frame); an earlieris.matrix()guard would have silently disabled it under any loo release that returns a data.frame.fs_infogain()gainednormalize = "gain_ratio"to correct information gain's bias toward high-cardinality predictors, and now discretizes the target once so scores are comparable across features.fs_lasso()no longer mean-imputes by default (impute = "none"); full-data imputation leaked across cross-validation folds. Scores are now standardized coefficients.fs_elastic()fits PCA inside each resample via caret'spreProcessinstead of once on the full data.fs_randomforest()runs thecontrol$feature_selecthook on the training split only.- Class upsampling in
fs_mars()andfs_svm()happens within resampling folds rather than before cross-validation. fs_recursivefeature()evaluates the selected subset on a held-out test split and trains its final model on training rows only.
-
fs_bayes()reads the model labelsloo::loo_compare()produces from itsmodelcolumn when present, falling back to row names. loo 2.10.0 moved those labels out of the row names, which would otherwise have made the selection rule map comparison rows to the wrong candidate models. -
fs_recursivefeature()coerces character and logical predictors to factors before fitting the one-hot encoder, so the encoder is not silently refitted on the test rows (caret::dummyVars()records levels only for columns that are already factors). -
fs_supervised()honorsna_rm = FALSEon the ANOVA path, wherestats::lm()'s own NA handling previously made it behave likena_rm = TRUE. -
fs_unsupervised()returns an undefined score rather than an error formethod = "iqr"withna_rm = FALSE. -
fs_lasso()computes standardized scores by position rather than by column name, so a design matrix with duplicated names cannot pair a coefficient with the wrong standard deviation. Itsnfoldsminimum is now 3, matching glmnet. -
fs_mars()checks for MLmetrics before selecting caret's multi-class summary, instead of a test that could never fail; multi-class targets no longer fail after the resamples have been computed. -
fs_correlation()rejects duplicated column names instead of silently resolving every lookup to the first match, which could replace one column's correlations with another's and drop both members of the pair. -
fs_boruta()validatesmaxRunsagainst Boruta's own minimum of 11, so the error names the featR argument rather than surfacing from the dependency. -
fs_lasso()reports non-finite predictor values as a user-input problem, naming the offending columns, rather than as an internal error. -
fs_elastic()no longer errors with "missing value where TRUE/FALSE needed" when a tuning result column containsNA. -
summary()on anfs_resultranks p-value scores ascending, sofs_chi()lists its most significant features first instead of last. -
print()on anfs_resultreports the recorded candidate count in preference to the number of scored features, so methods that score only a subset (such asfs_recursivefeature()) no longer report "Selected 2 of 2". -
The
fs_resultconstructor rejects an unnamed numericscoresvector and a zero-lengthtask, both of whichprint()andsummary()could not display. -
fs_bayes()samples predictor combinations without enumerating them, sosample_combinationsnow works at the scale it exists for: previously every subset was materialized first, which exhausted memory past roughly 25 predictors. An unbounded search over a very large subset space now errors with instructions instead of dying on allocation. -
fs_bayes()validatesbrm_family, so passing a family generator without parentheses reports the mistake instead of "object of type 'closure' is not subsettable". -
fs_bayes()supports families whosefitted()is a 3-D array (categorical, multinomial, multivariate). Selection proceeds; the in-sample MAE and RMSE, which are undefined for those responses, are reported asNArather than causing an error that was previously mislabelled as a sampling failure. -
fs_svm()errors rather than ranking features from a partially recovered weight vector, and reports a degenerate elimination-step fit as a featR error naming the likely cause instead of surfacing kernlab's. -
fs_recursivefeature()sets reproducible RNG streams on its parallel workers, so two seeded parallel runs agree, and stops its cluster if backend registration fails. -
fs_pca()rejectsscale_data = TRUEwithcenter_data = FALSE, which the two engines handled differently, and validatesnum_pcagainst the large-data engine's own limit. -
fs_randomforest()replaces only theNAentries of a per-classcontrol$sampsize, instead of discarding the sizes that were supplied. -
fs_infogain()refuses to expand a date column when the resulting<col>_year/_month/_dayname already exists. Previously that column was overwritten in place, silently, including when it was the target. -
fs_infogain()caps the automatic bin count at the number of observations. A near-constant column beside one extreme outlier drove the Freedman-Diaconis count past the integer range, which becameNAand madecut()fail with "invalid number of intervals". -
fs_chi()reportscorrection_appliedfrom whatstats::chisq.test()actually did. A 2x2 table sitting exactly at expectation receives no Yates correction even when one is requested, and the row previously claimed otherwise. -
fs_correlation()registers its cluster teardown before registering the parallel backend, so a failure there cannot leak the cluster, and restores the caller's own foreach backend instead of forcing sequential execution. -
fs_elastic()setsallowParallelfrom whether featR created a cluster. caret's default ofTRUEmeant a single-worker call would dispatch resamples to whatever backend the caller had registered elsewhere. -
fs_svm()'smin_keepis a floor rather than a quota: when random-forest RFE fails, the fallback keeps every predictor with positive impurity importance and only drops tomin_keeptop-ranked predictors if fewer qualify. It previously returned exactly one predictor. -
fs_mars()no longer fails on every call (a data.table was indexed with the matrix returned bycaret::createDataPartition()). -
fs_mars()sanitizes factor levels withmake.names(unique = TRUE), so distinct classes such as"class 1"and"class.1"can no longer merge. -
fs_lasso()accepts data frames containingNA(the previousmodel.matrix()call silently dropped those rows and then aborted). -
fs_pca()computes variance explained against total variance in the large-data path, labels its loadings, and no longer overflows on very large inputs. -
fs_correlation()reports point-biserial correlations with the correct sign. -
fs_randomforest()stratifies on the user's target rather than any column literally named"target", imputes test-only missing values, and accepts character predictors. -
fs_svd()errors on invalid arguments instead of silently repairing them.
- Modeling engines are Suggests; each function checks for what it needs.
- Functions never seed the RNG unless
seedis supplied, and restore the previous RNG state afterwards. - Execution is sequential by default; worker counts are opt-in and capped.
- No
library(),install.packages(),.GlobalEnvwrites, or log files in package code.