Learn R Programming

MachineShop (version 3.8.0)

set_strata: Resampling Stratification Control

Description

Set parameters that control the construction of strata during resample estimation of model performance.

Usage

set_strata(object, breaks = 4, nunique = 5, prop = 0.1, size = 20, ...)

Value

Argument object updated with the supplied parameters.

Arguments

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.

Details

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.

See Also

resample, set_monitor, set_optim, set_predict

Examples

Run this code
CVControl() %>% set_strata(breaks = 3)

Run the code above in your browser using DataLab