powered by
Set up weight matrix for subsampling with sample proportion \(1/2\) to be used with stabsel.
stabsel
subsample(weights, B = 100, strata = NULL)
a numeric vector of weights for the model to be cross-validated.
number of folds, per default 25 for bootstrap and subsampling and 10 for kfold.
bootstrap
subsampling
kfold
a factor of the same length as weights for stratification.
weights
The function subsample can be used to build an appropriate weight matrix to be used with stabsel. See there for more details.
subsample
If strata is defined sampling is performed in each stratum separately thus preserving the distribution of the strata variable in each fold.
strata
# NOT RUN { ## just a low-dimensional example subsample(weights = rep(1, 10), B = 50) # }
Run the code above in your browser using DataLab