Description
Usage
Arguments
Details
Value
Standard ResampleDesc objects
See Also
Examples
View source: R/ResampleDesc.R
A description of a resampling algorithm contains all necessary information to
create a ResampleInstance, when given the size of the data set.
 (method, = "test", , stratify = ,
stratify.cols = )

method 
(character(1) )
“CV” for crossvalidation, “LOO” for leaveoneout, “RepCV” for
repeated crossvalidation, “Bootstrap” for outofbag bootstrap, “Subsample” for
subsampling, “Holdout” for holdout, “GrowingWindowCV” for growing window
crossvalidation, “FixedWindowCV” for fixed window cross validation.

predict 
(character(1) )
What to predict during resampling: “train”, “test” or “both” sets.
Default is “test”.

... 
(any)
Further parameters for strategies.
 iters (
integer(1) ) Number of iterations, for “CV”, “Subsample”
and “Bootstrap”.
 split (
numeric(1) ) Proportion of training cases for “Holdout” and
“Subsample” between 0 and 1. Default is 2 / 3.
 reps (
integer(1) ) Repeats for “RepCV”. Here iters = folds * reps .
Default is 10.
 folds (
integer(1) ) Folds in the repeated CV for RepCV .
Here iters = folds * reps . Default is 10.
 horizon (
numeric(1) ) Number of observations in the forecast test set for “GrowingWindowCV”
and “FixedWindowCV”. When horizon > 1 this will be treated as the number of
observations to forecast, else it will be a fraction of the initial window. IE,
for 100 observations, initial window of .5, and horizon of .2, the test set will have
10 observations. Default is 1.
 initial.window (
numeric(1) ) Fraction of observations to start with
in the training set for “GrowingWindowCV” and “FixedWindowCV”.
When initial.window > 1 this will be treated as the number of
observations in the initial window, else it will be treated as the fraction
of observations to have in the initial window. Default is 0.5.
 skip (
numeric(1) ) How many resamples to skip to thin the total amount
for “GrowingWindowCV” and “FixedWindowCV”. This is passed through as the “by” argument
in seq() . When skip > 1 this will be treated as the increment of the sequence of resampling indices,
else it will be a fraction of the total training indices. IE for 100 training sets and a value of .2, the increment
of the resampling indices will be 20. Default is “horizon” which gives mutually exclusive chunks
of test indices.

stratify 
(logical(1) )
Should stratification be done for the target variable?
For classification tasks, this means that the resampling strategy is applied to all classes
individually and the resulting index sets are joined to make sure that the proportion of
observations in each training set is as in the original data set. Useful for imbalanced class sizes.
For survival tasks stratification is done on the events, resulting in training sets with comparable
censoring rates.

stratify.cols 
(character)
Stratify on specific columns referenced by name. All columns have to be factor or integer.
Note that you have to ensure yourself that stratification is possible, i.e.
that each strata contains enough observations.
This argument and stratify are mutually exclusive.

Some notes on some special strategies:
 Repeated crossvalidation
Use “RepCV”. Then you have to set the aggregation function
for your preferred performance measure to “testgroup.mean”
via setAggregation.
 B632 bootstrap
Use “Bootstrap” for bootstrap and set predict to “both”.
Then you have to set the aggregation function for your preferred performance measure to
“b632” via setAggregation.
 B632+ bootstrap
Use “Bootstrap” for bootstrap and set predict to “both”.
Then you have to set the aggregation function for your preferred performance measure to
“b632plus” via setAggregation.
 Fixed Holdout set
Use makeFixedHoldoutInstance.
Object slots:
 id (
character(1)
) Name of resampling strategy.
 iters (
integer(1)
) Number of iterations. Note that this is always the complete number
of generated train/test sets, so for a 10times repeated 5fold crossvalidation it would be 50.
 predict (
character(1)
) See argument.
 stratify (
logical(1)
) See argument.
 All parameters passed in ... under the respective argument name
See arguments.
(ResampleDesc).
For common resampling strategies you can save some typing
by using the following description objects:
 hout
holdout a.k.a. test sample estimation
(twothirds training set, onethird testing set)
 cv2
2fold crossvalidation
 cv3
3fold crossvalidation
 cv5
5fold crossvalidation
 cv10
10fold crossvalidation
Other resample: ResamplePrediction
,
ResampleResult
, addRRMeasure
,
getRRPredictionList
,
getRRPredictions
,
getRRTaskDescription
,
getRRTaskDesc
,
makeResampleInstance
,
resample
 # Bootstraping
("Bootstrap", iters = 10)
("Bootstrap", iters = 10, = "both")
# Subsampling
("Subsample", iters = 10, = 3/4)
("Subsample", iters = 10)
# Holdout a.k.a. test sample estimation
("Holdout")

berndbischl/mlr documentation built on June 18, 2018, 6:02 p.m.