CVscore {multiridge} | R Documentation |
Cross-validated score
Description
Cross-validated score for given penalty parameters.
Usage
CVscore(penalties, XXblocks, Y, X1 = NULL, pairing = NULL, folds, intercept =
ifelse(is(Y, "Surv"),FALSE, TRUE), frac1 = NULL, score = "loglik", model =
NULL, eps = 1e-07, maxItr = 100, trace = FALSE, printCV = TRUE, save = FALSE,
parallel = FALSE)
Arguments
penalties |
Numeric vector. |
XXblocks |
List of |
Y |
Response vector: numeric, binary, factor or |
X1 |
Matrix. Dimension |
pairing |
Numerical vector of length 3 or |
folds |
List of integer vector. Usually output of |
intercept |
Boolean. Should an intercept be included? |
frac1 |
Scalar. Prior fraction of cases. Only relevant for |
score |
Character. See Details. |
model |
Character. Any of |
eps |
Scalar. Numerical bound for IWLS convergence. |
maxItr |
Integer. Maximum number of iterations used in IWLS. |
trace |
Boolean. Should the output of the IWLS algorithm be traced? |
printCV |
Boolean. Should the CV-score be printed on screen? |
save |
Boolean. If TRUE appends the penalties and resulting CVscore to global variable |
parallel |
Boolean. Should computation be done in parallel? If |
Details
See Scoring
for details on score
.
Value
Numeric, cross-validated prediction score for given penalties
See Also
doubleCV
for double cross-validation, used for performance evaluation
Examples
data(dataXXmirmeth)
resp <- dataXXmirmeth[[1]]
XXmirmeth <- dataXXmirmeth[[2]]
# Find initial lambdas: fast CV per data block separately.
cvperblock2 <- fastCV2(XXblocks=XXmirmeth,Y=resp,kfold=10,fixedfolds = TRUE)
lambdas <- cvperblock2$lambdas
# Create training-test splits
leftout <- CVfolds(Y=resp,kfold=10,nrepeat=3,fixedfolds = TRUE)
CVscore(penalties=lambdas, XXblocks=XXmirmeth,Y=resp,folds=leftout,score="loglik")