Probabilistic Models¶
Variational CCA¶
-
class
cca_zoo.probabilisticmodels.probabilisticcca.
ProbabilisticCCA
(latent_dims=1, copy_data=True, random_state=0, num_samples=100, num_warmup=100)[source]¶ Bases:
cca_zoo.models._cca_base._CCA_Base
A class used to fit a Probabilistic CCA. Not quite the same due to using VI methods rather than EM
Citation: Bach, Francis R., and Michael I. Jordan. “A probabilistic interpretation of canonical correlation analysis.” (2005). Wang, Chong. “Variational Bayesian approach to canonical correlation analysis.” IEEE Transactions on Neural Networks 18.3 (2007): 905-910.
-
fit
(views, y=None, **kwargs)[source]¶ Infer the parameters (mu: mean, psi: within view variance) and latent variables (z) of the generative CCA model
Parameters: views ( Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples)
-
transform
(views, y=None, **kwargs)[source]¶ Predict the latent variables that generate the data in views using the sampled model parameters
Parameters: views ( Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples)
-
correlations
(views, **kwargs)¶ Predicts the correlations between each view for each dimension for the given data using the fit model
Parameters: - views (
Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples) - kwargs – any additional keyword arguments required by the given model
Returns: all_corrs: an array of the pairwise correlations (k,k,self.latent_dims) where k is the number of views
- views (
-
fit_transform
(views, **kwargs)¶ Fits and then transforms the training data
Parameters: - views (
Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples) - kwargs – any additional keyword arguments required by the given model
- views (
-
get_loadings
(views, normalize=False, **kwargs)¶ Returns the model loadings for each view for the given data
Parameters: - views (
Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples) - kwargs – any additional keyword arguments required by the given model
- normalize – scales loadings to ensure that they represent correlations between features and scores
- views (
-
score
(views, y=None, **kwargs)¶ Returns average correlation in each dimension (averages over all pairs for multiview)
Parameters: - views (
Iterable
[ndarray
]) – list/tuple of numpy arrays or array likes with the same number of rows (samples) - y – unused but needed to integrate with scikit-learn
- views (
-