Compute CPLS decomposition for large on-disk BPCells matrices. CPLS uses canonical correlation analysis (CCA) to determine loading weights, which can improve performance with multi-response or mixed-type response data.
# S3 method for class 'IterableMatrix'
cppls_ondisk(
X,
Y,
Y.add = NULL,
ncomp,
center = TRUE,
stripped = FALSE,
w.tol = 0,
X.tol = 1e-12,
threads = 1L,
...
)An IterableMatrix (features x samples, the BPCells convention). The transpose is handled internally.
A matrix or vector of primary responses (samples x q).
A matrix of additional responses (samples x q_add), or NULL. Y.add provides information that guides loading weights but does not enter the regression coefficients.
Integer; number of PLS components to compute.
Logical; whether to center X and Y (default TRUE).
Logical; if TRUE return only coefficients, Xmeans, and
Ymeans for speed (default FALSE).
Numeric; threshold for zeroing small loading weights (default 0).
Numeric; threshold for small-norm variable detection (default 1e-12).
Integer; number of threads for BPCells parallel computation.
1 (default) = single-threaded;
0 = auto-detect via parallel::detectCores(logical = FALSE);
values \(\ge 2\) use that many threads.
Additional arguments (currently unused).
A list with components:
Regression coefficients (p x q x ncomp array).
X-scores (n x ncomp matrix).
X-loadings (p x ncomp matrix).
Loading weights (p x ncomp matrix).
Y-scores (n x ncomp matrix).
Y-loadings (q x ncomp matrix).
Projection matrix (p x ncomp matrix).
Column means of X (length p).
Column means of Y (length q).
Fitted Y values (n x q x ncomp array).
Residuals (n x q x ncomp array).
Variance explained in X per component (length ncomp).
Total variance in X (scalar).
Power values per component (0.5 for all in this implementation).
Squared canonical correlations per component.
CCA weight vectors (q_full x ncomp matrix).
Indices of near-zero-norm variables.
If stripped = TRUE, only coefficients, Xmeans,
Ymeans, gammas, canonical.correlations, A,
and smallNorm are returned.