met.plot_PLS.Crossvalidation | R Documentation |
met.plot_PLS.Crossvalidation
performs cross-validation (CV) on the generated PLS-DA model, where a fraction of data is held back, and the model trained on the rest. In each CV, the predicted data are compared with the original data, and the sum of squared errors is calculated. The prediction error is then summed over all samples (Predicted Residual Sum of Squares or PRESS). For convenience, the PRESS is divided by the initial sum of squares and subtracted from 1 to resemble the scale of the R2. Good predictions will have low PRESS or high Q2. Generally speaking, a model with an R2 (and Q2) value above 0.7 can be considered predictive. It is possible to have negative Q2, which means that your model is not at all predictive or is overfitted.
met.plot_PLS.Crossvalidation(
mSetObj = NA,
imgName = "PLSDA-CrossValidation",
format = "pdf",
dpi = NULL,
width = NA,
plot = TRUE,
export = TRUE,
title = FALSE
)
mSetObj |
Input name of the created mSet object.
Data container after partial least squares-discriminant analysis ( |
imgName |
(Character) Enter a name for the image file (if |
format |
(Character, |
dpi |
(Numeric) resolution of the image file (if |
width |
(Numeric) width of the the image file in inches (if |
plot |
(Logical, |
export |
(Logical, |
title |
(Logical) |
The input mSet object with added cross validation test plot. The plot can be retrieved from within R via print(mSetObj$imgSet$pls.crossvalidation.plot)
.
Nicolas T. Wirth mail.nicowirth@gmail.com Technical University of Denmark License: GNU GPL (>= 2)
adapted from PlotPLS.Classification
(https://github.com/xia-lab/MetaboAnalystR).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.