class_docstr: Gaussian Kernel Density Estimation.
  
  Args:
      dataset (Tensor | None, optional): Dataset on which to fit the KDE model. Defaults to None.
docstr: Fit a KDE model to the input dataset.
  
  Args:
    dataset (Tensor): Input dataset.
  
  Returns:
      None
docstr_tok: ["Fit","a","KDE","model","to","the","input","dataset",".","Args",":","dataset","(","Tensor",")",":","Input","dataset",".","Returns",":","None"]
code: def fit(self, dataset: Tensor) -> None:
      """Fit a KDE model to the input dataset.
  
      Args:
        dataset (Tensor): Input dataset.
  
      Returns:
          None
      """
      num_samples, dimension = dataset.shape
  
      # compute scott's bandwidth factor
      factor = num_samples ** (-1 / (dimension + 4))
  
      cov_mat = self.cov(dataset.T)
      inv_cov_mat = torch.linalg.inv(cov_mat)
      inv_cov = inv_cov_mat / factor**2
  
      # transform data to account for bandwidth
      bw_transform = torch.linalg.cholesky(inv_cov)
      dataset = torch.matmul(dataset, bw_transform)
  
      #
      norm = torch.prod(torch.diag(bw_transform))
      norm *= math.pow((2 * math.pi), (-dimension / 2))
  
      self.bw_transform = bw_transform
      self.dataset = dataset
      self.norm = norm
  
file_path: anomalib/src/anomalib/models/components/stats/kde.py
imports: from __future__ import annotations
  import math
  import torch
  from torch import Tensor
  from anomalib.models.components.base import DynamicBufferModule
label_desc: Use image node_id 3 for calling the GaussianKDE obj's underlying member method code with example usage: obj.fit(dataset) without return types