View source: R/TrainingParams.R
set_strata | R Documentation |
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, ...)
object |
control object. |
breaks |
number of quantile bins desired for stratification of numeric data during resampling. |
nunique |
number of unique values at or below which numeric data are stratified as categorical. |
prop |
minimum proportion of data in each strata. |
size |
minimum number of values in each strata. |
... |
arguments passed to other methods. |
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.
Argument object
updated with the supplied parameters.
resample
, set_monitor
,
set_optim
, set_predict
CVControl() %>% set_strata(breaks = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.