docstr: Compute outlier scores and transform into outlier predictions.
  
  Parameters
  ----------
  X
      Batch of instances.
  return_instance_score
      Whether to return instance level outlier scores.
  
  Returns
  -------
  Dictionary containing ``'meta'`` and ``'data'`` dictionaries.
      - ``'meta'`` has the model's metadata.
      - ``'data'`` contains the outlier predictions and instance level outlier scores.
docstr_tok: ["Compute","outlier","scores","and","transform","into","outlier","predictions",".","Parameters","--","--","--","--","--","X","Batch","of","instances",".","return_instance_score","Whether","to","return","instance","level","outlier","scores",".","Returns","--","--","--","-","Dictionary","containing","``","'meta","'","``","and","``","'data","'","``","dictionaries",".","-","``","'meta","'","``","has","the","model","'s","metadata",".","-","``","'data","'","``","contains","the","outlier","predictions","and","instance","level","outlier","scores","."]
code: def predict(
      self, X: np.ndarray, return_instance_score: bool = True
  ) -> Dict[Dict[str, str], Dict[np.ndarray, np.ndarray]]:
      """
      Compute outlier scores and transform into outlier predictions.
  
      Parameters
      ----------
      X
          Batch of instances.
      return_instance_score
          Whether to return instance level outlier scores.
  
      Returns
      -------
      Dictionary containing ``'meta'`` and ``'data'`` dictionaries.
          - ``'meta'`` has the model's metadata.
          - ``'data'`` contains the outlier predictions and instance level outlier scores.
      """
      # convert categorical variables to numerical values
      X = self.cat2num(X)
  
      # compute outlier scores
      iscore = self.score(X)
  
      # values above threshold are outliers
      outlier_pred = (iscore > self.threshold).astype(int)
  
      # populate output dict
      od = outlier_prediction_dict()
      od["meta"] = self.meta
      od["data"]["is_outlier"] = outlier_pred
      if return_instance_score:
          od["data"]["instance_score"] = iscore
      return od
  
file_path: alibi-detect/alibi_detect/od/mahalanobis.py
imports: import logging
  import numpy
  from scipy.linalg import eigh
  from typing import Dict, Optional
  from alibi_detect.utils.discretizer import Discretizer
  from alibi_detect.utils.distance import abdm, mvdm, multidim_scaling
  from alibi_detect.utils.mapping import ohe2ord, ord2num
  from alibi_detect.base import BaseDetector, FitMixin, ThresholdMixin, outlier_prediction_dict
label_desc: Use image node_id 6 for calling the Mahalanobis obj's underlying member method code with example usage: obj.predict(X, return_instance_score) and returns: od