cca_zoo.datasets
.LatentVariableData#
- class cca_zoo.datasets.LatentVariableData(view_features: List[int], latent_dimensions: int = 1, random_state: int | RandomState = None, sparsity_levels: List[float] | float = None, positivity_constraints: bool | List[bool] = False, covariance_structure: str = 'identity', signal_to_noise_ratio: float = 1.0, rank: int = None, density: float = 1.0)[source]#
Bases:
_BaseData
This class generates data based on latent variable models. It allows for the specification of various parameters including the sparsity and structure of the data views, and the signal-to-noise ratio. It also supports sparse covariance matrix factorization to handle scenarios with a high number of features efficiently, reducing memory and computational demands.
- joint_covariance_matrix()[source]#
Computes the joint covariance matrix for all views.
- Returns:
The joint covariance matrix.
- sample(num_samples: int, return_latent: bool = False)[source]#
Generates samples from the latent variable model.
- Parameters:
num_samples – Number of samples to generate.
return_latent – Whether to return the latent variables along with the views.
- Returns:
Generated views and optionally the latent variables.