koplsPlotCVDiagnostics {kopls} | R Documentation |
Produces overview plots of cross-validation results retured from the koplsCV
function.
koplsPlotCVDiagnostics(model.full, plot.values = FALSE)
model.full |
The cross-validation model result (see koplsCV ). |
plot.values |
If TRUE, the exact values will be displayed on the bars as text labels. |
Produces 2x2 panels of bar plots, containing the total explained variation (R2X), the Y-orthogonal explained variation (R2XO), the Y-correlated explained variation (R2XC) and the predicted variation from cross-validation (Q2Y).
Max Bylesjo and Mattias Rantalainen
Rantalainen M, Bylesjo M, Cloarec O, Nicholson JK, Holmes E and Trygg J. Kernel-based orthogonal projections to latent structures (K-OPLS), J Chemometrics 2007; 21:376-385. doi:10.1002/cem.1071.
## Load data set data(koplsExample) ## Define kernel function parameter sigma<-25 ## Construct kernel Ktr<-koplsKernel(Xtr,NULL,'g',sigma) ## Find optimal number of Y-orthogonal components by cross-validation ## The cross-validation tests models with Y-orthogonal components 0 through numYo modelCV<-koplsCV(Ktr,Ytr,1,3,nrcv=7,cvType='nfold',preProcK='mc',preProcY='mc',modelType='da') ## Visualize results koplsPlotCVDiagnostics(modelCV) title("Statistics from K-OPLS cross-validation of original data")