get_joint_PCA_transforms

get_joint_PCA_transforms(features, labels, n_components=40, dim_red=<class 'sklearn.decomposition._pca.PCA'>)[source][source]

Calculates a shared latent space across features from multiple patients or recording sessions.

Uses the method described by Pandarinath et al. in https://www.nature.com/articles/s41592-018-0109-9 (2018) for pre-computing session specific read-in matrices (see Methods: Modifications to the LFADS algorithm for stitching together data from multiple recording sessions)

Parameters:
  • features (list) – List of features from multiple sources to compute shared latent space.

  • labels (list) – List of labels corresponding to feature sources. Must be the same length as features.

  • n_components (int, optional) – Number of components for dimensionality reduction i.e. dimensionality of latent space. Defaults to 40.

  • dim_red (Callable, optional) – Dimensionality reduction function. Must implement sklearn-style fit_transform() function. Defaults to PCA.

Returns:

Tuple containing transformation matrices to shared latent space for each input source. Length will be equal to the length of the input feature list.

Return type:

tuple