| predict.msma | R Documentation |
Projects supplied X-side and, for PLS, Y-side data into the fitted component spaces and returns component scores and low-rank reconstructions.
## S3 method for class 'msma'
predict(object, newX, newY = NULL, ...)
object |
an object of class |
newX |
a numeric matrix or list of numeric matrices for the X side. |
newY |
an optional numeric matrix or list of numeric matrices for
the Y side. Fitted PLS prediction requires |
... |
additional prediction controls:
|
This method does not predict Y from X. When newY is supplied,
X and Y are projected and reconstructed independently in their
corresponding fitted component spaces.
Historical prediction behavior remains the default. Additional
Version 5 prediction controls can be supplied through ....
Fitted reconstruction and original-scale output require
preprocessing = \"fitted\". Scores remain on the analysis scale.
a list with four elements:
XX-side low-rank reconstructions.
sbXX-side component scores on the analysis scale.
YY-side low-rank reconstructions, or NULL for PCA.
sbYY-side component scores, or NULL for PCA.
set.seed(1)
X <- matrix(rnorm(180), nrow = 30, ncol = 6)
colnames(X) <- paste0("x", seq_len(ncol(X)))
fit <- msma(X = X, comp = 2, scaling = TRUE, intseed = 3)
prediction <- predict(
fit,
newX = X[1:5, , drop = FALSE],
preprocessing = "fitted",
reconstruction = "fitted",
output_scale = "original"
)
names(prediction)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.