piglot.optimisers.botorch.dataset.PCA
- class PCA(variance: float)[source]
Bases:
objectPrincipal Component Analysis transformation.
Methods
Fit the PCA transformation to the given data.
Move the PCA to a given device.
Transform data to the latent space.
Transform data back to the original space.
- fit(data: Tensor, covariances: Tensor) None[source]
Fit the PCA transformation to the given data.
Parameters
- datatorch.Tensor
Data to fit the PCA transformation to.
- covariancestorch.Tensor
Covariances of the data to fit the PCA transformation to.
- to(device: str) PCA[source]
Move the PCA to a given device.
Parameters
- devicestr
Device to move the PCA to.
Returns
- PCA
The PCA in the new device.
- transform(values: torch.Tensor, covariances: torch.Tensor | None = None) torch.Tensor | Tuple[torch.Tensor, torch.Tensor][source]
Transform data to the latent space.
Parameters
- valuestorch.Tensor
Values to transform.
- covariancestorch.Tensor | None
Variances to transform, if any.
Returns
- torch.Tensor | Tuple[torch.Tensor, torch.Tensor]
Transformed values and covariances (if any).