resample(method, y, ..., subset = TRUE)resample_holdout(y = NULL, fraction = 0.5, nfold = 5,
balanced = is.factor(y), subset)
resample_crossvalidation(y, nfold = 5, nreplicate = 5,
balanced = is.factor(y), subset)
"holdout" or
"crossvalidation"."resample_holdout".y that are to be divided and which
that are not to be part of neither set.
If subset is a resampling scheme, a list of inner
cross-validation schemes will be returned.TRUE or a positive integer
codes for training set and FALSE or 0 codes for test set.
Positive integers > 1 code for multiple copies of an observation in the
training set. NA codes for neither training nor test set and is
used to exclude observations from the analysis altogether.resample_holdout or resample_crossvalidation directly, as
resample performs additional necessary processing of the scheme.Resampling scheme can be visualized in a human digestible form with the
image function.
Functions for generating custom resampling schemes should be implemented as
follows and then called by resample("myMethod", ...):
resample_myMethod <- function(y, ..., subset)
[object Object],[object Object],[object Object]
The function should return a list of the following elements:
[object Object],[object Object]
emil, subresample,
image.resample, index_fitresample("holdout", 50, fraction=1/3)
resample("holdout", factor(runif(60) >= .5))
y <- factor(runif(60) >= .5)
cv <- resample("crossvalidation", y)
image(cv, main="Cross-validation scheme")Run the code above in your browser using DataLab