Description Usage Arguments Details Value Examples
A wrapper function that implements nested K-fold cross validation for a chosen algorithm with binary data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | nested_cv(y, X, type, K = c(10, 10), control = list(),
set_control = list(), progress = T)
is.nested_cv(x)
## S3 method for class 'nested_cv'
levels(x)
## S3 method for class 'nested_cv'
dimnames(x)
## S3 method for class 'nested_cv'
coef(x, int = T)
## S3 method for class 'nested_cv'
print(x, digits = 2, metric = "AUC")
## S3 method for class 'nested_cv'
summary(x, metric = "AUC")
## S3 method for class 'nested_cv'
features(x, cutoff = 0.95)
|
y |
A factor with two levels. |
X |
A matrix of predictors with the number of rows equal
to the length of |
type |
The type of fitting algorithm to use. Options
include |
K |
A vector indicating the number of folds to use for the outer and inner iterations. |
control |
List of additional settings for the estimation algorithm for the inner folds. |
set_control |
A function to specify how to set the
|
progress |
Logical; if |
The method summary returns a list with
the coefficients and their significance for the outer
folds and the inner folds per each outer fold, respectively.
An R object of class 'nested_cv'.
1 2 3 4 5 6 | # Simulate data
sim = bc_simulate( 500, 8, 4 )
# Conduct nested 10-fold CV
cv_glm = nested_cv( sim$y, sim$X, type = 'glm' )
# Can be slow
cv_glmnet = nested_cv( sim$y, sim$X, type = 'glmnet' )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.