docstr: Convert categorical variables to numerical values.
  
  Parameters
  ----------
  X
      Batch of instances to analyze.
  
  Returns
  -------
  Batch of instances where categorical variables are converted to numerical values.
docstr_tok: ["Convert","categorical","variables","to","numerical","values",".","Parameters","--","--","--","--","--","X","Batch","of","instances","to","analyze",".","Returns","--","--","--","-","Batch","of","instances","where","categorical","variables","are","converted","to","numerical","values","."]
code: def cat2num(self, X: np.ndarray) -> np.ndarray:
      """
      Convert categorical variables to numerical values.
  
      Parameters
      ----------
      X
          Batch of instances to analyze.
  
      Returns
      -------
      Batch of instances where categorical variables are converted to numerical values.
      """
      if self.cat_vars is not None:  # convert categorical variables
          if self.ohe:
              X = ohe2ord(X, self.cat_vars)[0]
          X = ord2num(X, self.d_abs)
      return X
  
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 4 for calling the Mahalanobis obj's underlying member method code with example usage: obj.cat2num(X) and returns: X