class_docstr: Principle Component Analysis (PCA).
  
  Args:
      n_components (float): Number of components. Can be either integer number of components
        or a ratio between 0-1.
docstr: Fit and transform PCA to dataset.
  
  Args:
    dataset (Tensor): Dataset to which the PCA if fit and transformed
  
  Returns:
    Transformed dataset
code: def fit_transform(self, dataset: Tensor) -> Tensor:
      """Fit and transform PCA to dataset.
  
      Args:
        dataset (Tensor): Dataset to which the PCA if fit and transformed
  
      Returns:
        Transformed dataset
      """
      mean = dataset.mean(dim=0)
      dataset -= mean
      num_components = int(self.n_components)
      self.num_components = Tensor([num_components])
  
      v_h = torch.linalg.svd(dataset)[-1]
      self.singular_vectors = v_h.transpose(-2, -1)[:, :num_components]
      self.mean = mean
  
      return torch.matmul(dataset, self.singular_vectors)
  
file_path: anomalib/src/anomalib/models/components/dimensionality_reduction/pca.py
imports: from __future__ import annotations
  import torch
  from torch import Tensor
  from anomalib.models.components.base import DynamicBufferModule
label_desc: Use image node_id 3 for calling the PCA obj's underlying member method code with example usage: obj.fit_transform(dataset) and returns: torch