multiblock_projector | R Documentation |
Constructs a multiblock projector using the given component matrix (v
), a preprocessing function, and a list of block indices.
This allows for the projection of multiblock data, where each block represents a different set of variables or features.
multiblock_projector(
v,
preproc = prep(pass()),
...,
block_indices,
classes = NULL
)
v |
A matrix of components with dimensions |
preproc |
A pre-processing function for the data (default: |
... |
Extra arguments. |
block_indices |
A list of numeric vectors specifying the indices of each data block. |
classes |
(optional) A character vector specifying additional class attributes of the object, default is NULL. |
A multiblock_projector
object.
projector
# Generate some example data
X1 <- matrix(rnorm(10 * 5), 10, 5)
X2 <- matrix(rnorm(10 * 5), 10, 5)
X <- cbind(X1, X2)
# Compute PCA on the combined data
pc <- pca(X, ncomp = 8)
# Create a multiblock projector using PCA components and block indices
mb_proj <- multiblock_projector(pc$v, block_indices = list(1:5, 6:10))
# Project multiblock data using the multiblock projector
mb_scores <- project(mb_proj, X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.