R/ife_ml.R
runIFE.RdrunIFE Removes top features identified by ML models and retrains iteratively; returns nMCC at each iteration.
runIFE(
ml_input_tibble,
by_num = TRUE,
by_vi = FALSE,
percent_removal_vec = 10 * 1:9,
mix_vec = 0,
return_feats = FALSE,
verbose = TRUE
)An ML-ready tibble generated by loadMLInputTibble()
bool Set to TRUE if removing top features as a percentage
of the total number of features.
bool Set to TRUE if removing top features by their
contribution to the total variable importance.
num A vector of percentages of total top
features removed (if by_num = TRUE and by_vi = FALSE) or percent
contributions of top features removed to the total variable importance (if
by_vi = TRUE and by_num = FALSE) at each iteration. The function will
automatically train with all features to start, so there is no need to
specify 0 in this vector.
num A vector containing mixture values (0 corresponds to L2 regularization; 1 corresponds to L1; intermediate values correspond to elastic net) to try. The default corresponds to L2 for the purpose of IFE analysis.
bool Whether to return top features from each iteration of IFE.
bool The function will stay quiet if set to FALSE.
A tibble with IFE performance (note: this will be returned within a
list along with top features removed per iteration if return_feats = TRUE.)
data(demo_ml_tibble)
set.seed(1)
runIFE(
demo_ml_tibble,
by_num = TRUE, by_vi = FALSE,
percent_removal_vec = c(25, 50), mix_vec = 0,
return_feats = TRUE, verbose = FALSE
)
#> Warning: Classes are roughly balanced. Calculation of log2(AUPRC/prior) may be inappropriate.
#> Warning: Classes are roughly balanced. Calculation of log2(AUPRC/prior) may be inappropriate.
#> → A | error: x should be a matrix with 2 or more columns
#> There were issues with some computations A: x1
#> Warning: All models failed. Run `show_notes(.Last.tune.result)` for more information.
#> There were issues with some computations A: x1
#>