View source: R/multiscaleSVDxpts.R
multiview_pca | R Documentation |
Perform Multiview PCA on multiple datasets with an option for sparse PCA.
multiview_pca(
views,
n_components,
sparse = 0.5,
max_iter = 100,
sparsenessAlg = "basic",
verbose = FALSE
)
views |
A list of data matrices for each view. |
n_components |
Number of principal components to compute. |
sparse |
vector of length views with values between zero and one |
max_iter |
Maximum number of iterations for the optimization. |
sparsenessAlg |
NA is default otherwise basic, spmp or orthorank |
verbose |
Logical, whether to print information about energy and sparsity. |
A list containing the common representation Z and transformation matrices W.
set.seed(123)
n_samples <- 100
n_features_1 <- 50
n_features_2 <- 60
n_features_3 <- 70
n_components <- 5
view1 <- matrix(rnorm(n_samples * n_features_1), nrow = n_samples, ncol = n_features_1)
view2 <- matrix(rnorm(n_samples * n_features_2), nrow = n_samples, ncol = n_features_2)
view3 <- matrix(rnorm(n_samples * n_features_3), nrow = n_samples, ncol = n_features_3)
result <- multiview_pca(list(view1, view2, view3), n_components, sparse = rep(0.5,3),
verbose = TRUE)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.