Calculate the contrastive PCA
rs_contrastive_pca.RdThis function calculate the contrastive PCA given a target covariance matrix and the background covariance matrix you wish to subtract. The alpha parameter controls how much of the background covariance you wish to remove. You have the options to return the feature loadings and you can specificy the number of cPCAs to return. WARNING! Incorrect use can cause kernel crashes. Wrapper around the Rust functions with type checks are provided in the package.
Usage
rs_contrastive_pca(
target_covar,
background_covar,
target_mat,
alpha,
n_pcs,
return_loadings
)Arguments
- target_covar
The co-variance matrix of the target data set.
- background_covar
The co-variance matrix of the background data set.
- target_mat
The original values of the target matrix.
- alpha
How much of the background co-variance should be removed.
- n_pcs
How many contrastive PCs to return
- return_loadings
Shall the loadings be returned from the contrastive PCA