Compute kernel-PLS decomposition for large on-disk BPCells matrices using the algorithm of Dayal and MacGregor (1997).

# S3 method for class 'IterableMatrix'
kernelpls(X, Y, ncomp, center = TRUE, stripped = FALSE, threads = 1L, ...)

Arguments

X

An IterableMatrix (features x samples, the BPCells convention). The transpose is handled internally.

Y

A matrix or vector of responses (samples x q).

ncomp

Integer; number of PLS components to compute.

center

Logical; whether to center X and Y (default TRUE).

stripped

Logical; if TRUE return only coefficients, Xmeans, and Ymeans for speed (default FALSE).

threads

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).

Value

A list with components:

coefficients

Regression coefficients (p x q x ncomp array).

scores

X-scores (n x ncomp matrix).

loadings

X-loadings (p x ncomp matrix).

loading.weights

Loading weights (p x ncomp matrix).

Yscores

Y-scores (n x ncomp matrix).

Yloadings

Y-loadings (q x ncomp matrix).

projection

Projection matrix (p x ncomp matrix).

Xmeans

Column means of X (length p).

Ymeans

Column means of Y (length q).

fitted.values

Fitted Y values (n x q x ncomp array).

residuals

Residuals (n x q x ncomp array).

Xvar

Variance explained in X per component (length ncomp).

Xtotvar

Total variance in X (scalar).

If stripped = TRUE, only coefficients, Xmeans, and Ymeans are returned.

Details

Implements the kernel-PLS algorithm (Dayal & MacGregor, 1997) for BPCells on-disk matrices. The large predictor matrix X is accessed from disk column-by-column; the response matrix Y is kept in memory.

References

Dayal, B. S. and MacGregor, J. F. (1997) Improved PLS algorithms. Journal of Chemometrics, 11, 73–85.