Control Object for Selection By Filtering (SBF)
Controls the execution of models with simple filters for feature selection
sbfControl(functions = NULL, method = "boot", saveDetails = FALSE, number = ifelse(method %in% c("cv", "repeatedcv"), 10, 25), repeats = ifelse(method %in% c("cv", "repeatedcv"), 1, number), verbose = FALSE, returnResamp = "final", p = 0.75, index = NULL, indexOut = NULL, timingSamps = 0, seeds = NA, allowParallel = TRUE, multivariate = FALSE)
- a list of functions for model fitting, prediction and variable filtering (see Details below)
- The external resampling method:
LGOCV(for repeated training/test splits
- Either the number of folds or number of resampling iterations
- For repeated k-fold cross-validation only: the number of complete sets of folds to compute
- a logical to save the predictions and variable importances from the selection process
- a logical to print a log for each external resampling iteration
- A character string indicating how much of the resampled summary metrics should be saved. Values can be ``final'' or ``none''
- For leave-group out cross-validation: the training percentage
- a list with elements for each external resampling iteration. Each list element is the sample rows used for training at that iteration.
- a list (the same length as
index) that dictates which sample are held-out for each resample. If
NULL, then the unique set of samples not contained in
- the number of training set samples that will be used to measure the time for predicting samples (zero indicates that the prediction time should not be estimated).
- an optional set of integers that will be used to set the seed at each resampling iteration. This is useful when the models are run in parallel. A value of
NAwill stop the seed from being set within the worker processes while a value of
- if a parallel backend is loaded and available, should the function use it?
- a logical; should all the columns of
xbe exposed to the
scorefunction at once?
More details on this function can be found at
Simple filter-based feature selection requires function to be specified for some operations.
fit function builds the model based on the current data set. The arguments for the function must be:
- a list that echos the specified arguments
data(BloodBrain) ## Use a GAM is the filter, then fit a random forest model set.seed(1) RFwithGAM <- sbf(bbbDescr, logBBB, sbfControl = sbfControl(functions = rfSBF, verbose = FALSE, seeds = sample.int(100000, 11), method = "cv")) RFwithGAM ## A simple example for multivariate scoring rfSBF2 <- rfSBF rfSBF2$score <- function(x, y) apply(x, 2, rfSBF$score, y = y) set.seed(1) RFwithGAM2 <- sbf(bbbDescr, logBBB, sbfControl = sbfControl(functions = rfSBF2, verbose = FALSE, seeds = sample.int(100000, 11), method = "cv", multivariate = TRUE)) RFwithGAM2