View source: R/utility_functions.R
get_best_predictions | R Documentation |
Returns the CV predictions associated with the best performing tuning parameters. If there are multiple CV repeats, these are separated.
get_best_predictions(trainobj, rep = NA, ncomp = NA, keepX = NA, keepY = NA)
trainobj |
The |
rep |
If trainobj was fit using repeated cross-validation, choose a repeat (e.g. "Rep1") or leave as NA for all repeats (default). |
ncomp |
Manually select CV predictions with this parameter, instead of the best one from |
keepX |
Manually select CV predictions with this parameter, instead of the best one from |
keepY |
Manually select CV predictions with this parameter, instead of the best one from |
A data.frame
with the variables
pred
- the predicted values
obs
- the observed values
ncomp
- Tuning variable
keepX
- Tuning variable
keepY
- Tuning variable
fold
- Cross-validation fold
rep
- Repeat number (for repeated CV)
library(caret) x <- data.frame(matrix(rnorm(1000),nrow = 100)) y <- rnorm(100) PLS <- train(x = x, y = y, method = get_mixOmics_spls()) getBestPredictions(PLS)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.