Resampler | R Documentation |
Model validation by repeated bootstrapping
[R6::R6Class] object.
Uses repeated bootstrapping to validate models without a test data set. For each experiment multiple metrics are measured. For classification experiments the confusion matrix is calculated additionally. In order to test hypotheses, either features or the response variable can be permuted.
permute
returns the instance variable 'permute'. (character)
permute_alphabet
returns the instance variable 'permute_alphabet'. (character)
n_resample
returns the instance variable 'n_resample'. (integer)
fml_method
returns the instance variable 'fml_method'. (character)
fml_type
returns the instance variable 'fml_type'. (character)
fml_type_alphabet
returns the instance variable 'fml_type_alphabet'. (character)
pre_process_lst
returns the instance variable 'pre_process_lst'. (character)
hyper_parameters
returns the instance variable 'hyper_parameters'. (list)
response_var
returns the instance variable 'response_var'. (character)
n_features
returns the instance variable 'n_features'. (integer)
strata_var
returns the instance variable 'strata_var'. (character)
metrics_df
returns the instance variable 'metrics_df'. (tibble::tibble)
confusion_df
returns the instance variable 'confusion_df'. (tibble::tibble)
new()
checks, if permutation is requested. If true, performs the permutation task.
Checks if ml.type is classification. If true, calculates confusion matrix.
Creates and returns instance of Resampler class.
Resampler$new( n_resample = 500, fml_method = "pcr", fml_type = "classification", hyper_parameters = "list", pre_process_lst = c("center", "scale"), permute = NULL, n_features = 0, response_var = "character", strata_var = NULL )
n_resample
number of bootstrap resamples. The default is 500 (integer)
fml_method
ML model that is being used. The default is 'pcr' (character).
fml_type
ML model type. Needs to be 'classification', 'regression' or 'censored'. Default is 'classification' (character).
hyper_parameters
List of model hyper parameters. (list)
pre_process_lst
Vector of pre-processing steps. Default is 'c("center", "scale")' (character).
permute
Permutation method. Needs to be 'none', 'features' or 'response'. (character)
n_features
Number of features to be chosen in the permutation experiment. Default is 0 (integer).
response_var
Response variable of the model (character).
strata_var
Stratification variable (character).
Resampler
print()
Print instance variables of Resampler class.
Resampler$print()
character
fit()
Runs the bootstrap analysis based on the instance variables chosen under initialize.
Resampler$fit(data_df = "tbl_df")
data_df
data set to be analyzed (tibble::tibble).
None
clone()
The objects of this class are cloneable with this method.
Resampler$clone(deep = FALSE)
deep
Whether to make a deep clone.
Sebastian Malkusch
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.