JointPCADecomp¶
- class JointPCADecomp(n_components=40, dim_red=<class 'sklearn.decomposition._pca.PCA'>)[source][source]¶
- fit(X, y)[source][source]¶
Learns source-specific (e.g. patient-specific) transformations to the shared latent space and stores transformations in self.transforms.
- fit_transform(X, y)[source][source]¶
Fits the model with X and y and applies the learned transformations to X.
- Parameters:
- Returns:
Tuple containing transformed ndarray data from all sources input to the fit() method. Length will be equal to the number of learned transformations.
- Return type:
- transform(X, idx=-1)[source][source]¶
Applies learned transformations to input data. Supports transforming a single, specified dataset or all-source datasets at once.
- Parameters:
X (
ndarrayorlistofndarray) – Features to transform. If a list, the length must be equal to the number of learned transforms (i.e. transforming all sources). If an ndarray, a source-specific transformation is applied to the data, with the source specified by the idx input.idx (
int, optional) – Index of saved transform list to apply to single source data, or -1 if applying to all sources. Defaults to -1.
- Raises:
IndexError – Error if idx is too large to select a learned transform from the saved list.
RuntimeError – Error if fit() has not been called before calling transform().
- Returns:
Transformed data from single session if idx is not -1, or a tuple of containing:
Transformed data from all sources input to the fit() method. Length will be equal to the number of learned transformations.
- Return type:
ndarrayortuple