View source: R/rgcca_transform.R
rgcca_transform | R Documentation |
This function projects testing blocks using the block weight vectors of a fitted RGCCA object.
rgcca_transform(rgcca_res, blocks_test = rgcca_res$call$blocks)
rgcca_res |
A fitted RGCCA object (see |
blocks_test |
A list of blocks (data.frame or matrix) to be projected. |
A list of matrices containing the projections of the test blocks using the block weight vectors of a fitted RGCCA object.
data("Russett")
blocks <- list(
agriculture = Russett[, 1:3],
industry = Russett[, 4:5],
politic = Russett[, 6:11])
Xtrain <- lapply(blocks, function(x) x[1:32, ])
Xtest <- lapply(blocks, function(x) x[33:47, ])
fit_rgcca <- rgcca(Xtrain, ncomp = 2)
projection <- rgcca_transform(fit_rgcca, Xtest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.