Task to use a fraction of the rows.
Sampling happens only during training phase. Subsampling a
Task may be
beneficial for training time at possibly (depending on original
negligible cost of predictive performance.
R6Class object inheriting from
PipeOpSubsample$new(id = "subsample", param_vals = list())
Identifier of the resulting object, default
param_vals :: named
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction. Default
Input and output channels are inherited from
The output during training is the input
Task with added or removed rows according to the sampling.
The output during prediction is the unchanged input.
$state is a named
list with the
$state elements inherited from
The parameters are the parameters inherited from
PipeOpTaskPreproc; however, the
affect_columns parameter is not present. Further parameters are:
Fraction of rows in the
Task to keep. May only be greater than 1 if
TRUE. Initialized to
(1 - exp(-1)) == 0.6321.
Should the subsamples be stratified by target? Initialized to
FALSE. May only be
Sample with replacement? Initialized to
task$filter() to remove rows. If
TRUE and identical rows are added, then the
task$row_roles$use can not be used
to duplicate rows because of [inaudible]; instead the
task$rbind() function is used, and
data.table is attached that contains all rows that are being duplicated exactly as many times as they are being added.
Only fields inherited from
Only methods inherited from
library("mlr3") pos = mlr_pipeops$get("subsample", param_vals = list(frac = 0.7, stratify = TRUE)) pos$train(list(tsk("iris")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.