bpca.BPCA#
- class bpca.BPCA(n_components=None, max_iter=1000, tolerance=0.0001)#
Bayesian principal component analysis (BPCA)
Implements the BPCA method (generative model suggested by Bishop, 1998) as suggested by Oba et al (2003). The implementation follows the reference implementation in R (Stacklies, 2007).
Examples
from bpca import BPCA from sklearn.datasets import load_iris iris_dataset = load_iris() X = iris_dataset["data"] # (n_obs, n_var) bpca = BPCA(n_components=None) usage = bpca.fit_transform(X) # (n_components, n_latent) weights = bpca.components_ # (n_latent, n_var)
Citation#
Bishop, C. Bayesian PCA. in Advances in Neural Information Processing Systems vol. 11 (MIT Press, 1998).
Oba, S. et al. A Bayesian missing value estimation method for gene expression profile data. Bioinformatics 19, 2088 - 2096 (2003).
Stacklies, W., Redestig, H., Scholz, M., Walther, D. & Selbig, J. pcaMethods—a bioconductor package providing PCA methods for incomplete data. Bioinformatics 23, 1164 - 1167 (2007).
Attributes table#
Estimated regularization strength by EM algorithm. |
|
Principal axes in feature space ( |
|
Fraction of variance explained by each of the selected components ( |
|
Estimated feature-wise mean by EM algorithm. |
|
Number of components ( |
|
Number of iterations |
|
Estimated variance by EM algorithm. |
Methods table#
Attributes#
- BPCA.alpha#
Estimated regularization strength by EM algorithm.
- BPCA.components_#
Principal axes in feature space (
n_components_,n_features).
- BPCA.explained_variance_ratio_#
Fraction of variance explained by each of the selected components (
n_components_,).
- BPCA.mu#
Estimated feature-wise mean by EM algorithm.
- BPCA.n_components_#
Number of components (
n_components_,).
- BPCA.n_iter#
Number of iterations
- BPCA.tau#
Estimated variance by EM algorithm.
Methods#
- BPCA.fit(X)#
Fit parameters.
- BPCA.fit_transform(X)#
Fit model and return transformed training data.