Set parameters that control the construction of strata during resample estimation of model performance.
set_strata(object, breaks = 4, nunique = 5, prop = 0.1, size = 20, ...)
control object.
number of quantile bins desired for stratification of numeric data during resampling.
number of unique values at or below which numeric data are stratified as categorical.
minimum proportion of data in each strata.
minimum number of values in each strata.
arguments passed to other methods.
Argument object
updated with the supplied parameters.
The arguments control resampling strata which are constructed from numeric
proportions for BinomialVariate
; original values for
character
, factor
, logical
, numeric
, and
ordered
; first columns of values for matrix
; and numeric times
within event statuses for Surv
. Stratification of survival data by
event status only can be achieved by setting breaks = 1
. Numeric
values are stratified into quantile bins and categorical values into factor
levels. The number of bins will be the largest integer less than or equal to
breaks
satisfying the prop
and size
control argument
thresholds. Categorical levels below the thresholds will be pooled
iteratively by reassigning values in the smallest nominal level to the
remaining ones at random and by combining the smallest adjacent ordinal
levels. Missing values are replaced with non-missing values sampled at
random with replacement.
# NOT RUN {
CVControl() %>% set_strata(breaks = 3)
# }
Run the code above in your browser using DataLab