PredictMultiBlock: PredictMultiBlock

View source: R/PredictMultiBlock.R

PredictMultiBlockR Documentation

PredictMultiBlock

Description

Projects a new MultiBlock dataset into an existing ComDim model. Works with models produced by ComDim_PCA, ComDim_PLS, ComDim_OPLS, ComDim_y, and ComDim_Exploratory. The projection type (PCA-like, PLS-like, OPLS-like) is determined from the model structure rather than the method string, so custom method labels from ComDim_y are handled automatically.

Usage

PredictMultiBlock(MB = MB, y, model = model, normalise = FALSE, loquace = TRUE)

Arguments

MB

A MultiBlock object containing the new samples to project.

y

Response vector or dummy matrix (optional). When supplied for a supervised model, Q2, DQ2, and classification statistics are computed for the new samples.

model

A ComDim object (the calibration model).

normalise

If TRUE, each block is mean-centred using the training column means and divided by the training Frobenius norm. Must match the normalise setting used during calibration. Default FALSE.

loquace

If TRUE, print a message for each set of model elements that were projected. Default TRUE.

Value

The model ComDim object with updated slots:

  • Q.scores — projected global scores (new samples x ndim).

  • T.scores — projected local scores (per block).

  • Orthogonal$Q.scores — projected global ort scores (if model has orthogonal components).

  • Orthogonal$T.scores — projected local ort scores.

  • Prediction$Y.pred — predicted Y (supervised models).

  • Q2, DQ2, classification slots — when y is supplied for a supervised model.


R.ComDim documentation built on May 13, 2026, 9:07 a.m.