Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

subsample

Draw Random Subsamples


Description

Set up weight matrix for subsampling with sample proportion 1/2 to be used with stabsel.

Usage

subsample(weights, B = 100, strata = NULL)

Arguments

weights

a numeric vector of weights for the model to be cross-validated.

B

number of folds, per default 25 for bootstrap and subsampling and 10 for kfold.

strata

a factor of the same length as weights for stratification.

Details

The function subsample can be used to build an appropriate weight matrix to be used with stabsel. See there for more details.

If strata is defined sampling is performed in each stratum separately thus preserving the distribution of the strata variable in each fold.

See Also

Examples

## just a low-dimensional example
  subsample(weights = rep(1, 10), B = 50)

stabs

Stability Selection with Error Control

v0.6-4
GPL-2
Authors
Benjamin Hofner [aut, cre], Torsten Hothorn [aut]
Initial release
2021-01-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.