docstr: Fit the detector on reference data.
  
  Fitting the Mahalanobis detector amounts to computing the covariance matrix and its eigenvectors. We filter out
  very small eigenvalues using the `min_eigenvalue` parameter. We then scale the eigenvectors such that the data
  projected onto them has mean ``0`` and std ``1``.
  
  Parameters
  ----------
  x_ref
      Reference data used to fit the detector.
docstr_tok: ["Fit","the","detector","on","reference","data",".","Fitting","the","Mahalanobis","detector","amounts","to","computing","the","covariance","matrix","and","its","eigenvectors",".","We","filter","out","very","small","eigenvalues","using","the","`","min_eigenvalue","`","parameter",".","We","then","scale","the","eigenvectors","such","that","the","data","projected","onto","them","has","mean","``","0","``","and","std","``","1","``",".","Parameters","--","--","--","--","--","x_ref","Reference","data","used","to","fit","the","detector","."]
code: def fit(self, x_ref: np.ndarray) -> None:
      """Fit the detector on reference data.
  
      Fitting the Mahalanobis detector amounts to computing the covariance matrix and its eigenvectors. We filter out
      very small eigenvalues using the `min_eigenvalue` parameter. We then scale the eigenvectors such that the data
      projected onto them has mean ``0`` and std ``1``.
  
      Parameters
      ----------
      x_ref
          Reference data used to fit the detector.
      """
      self.backend.fit(self.backend._to_backend_dtype(x_ref))
  
file_path: alibi-detect/alibi_detect/od/_mahalanobis.py
imports: from typing import Dict, Any
  from alibi_detect.exceptions import _catch_error
  from typing_extensions import Literal
  import numpy
  from alibi_detect.base import BaseDetector, FitMixin, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.od.pytorch import MahalanobisTorch
  from alibi_detect.utils.frameworks import BackendValidator
  from alibi_detect.version import __version__
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 2 for calling the Mahalanobis obj's underlying member method code with example usage: obj.fit(x_ref) without return types