docstr: Fit discretizer to train data to bin numerical features into ordered bins and compute statistics for
  numerical features. Create a mapping between the bin numbers of each discretised numerical feature and the
  row id in the training set where it occurs.
  
  Parameters
  ----------
  train_data
      Representative sample from the training data.
  disc_perc
      List with percentiles (`int`) used for discretization.
code: def fit(
      self,  # type: ignore[override]
      train_data: np.ndarray,
      disc_perc: Tuple[Union[int, float], ...] = (25, 50, 75),
      **kwargs,
  ) -> "AnchorTabular":
      """
      Fit discretizer to train data to bin numerical features into ordered bins and compute statistics for
      numerical features. Create a mapping between the bin numbers of each discretised numerical feature and the
      row id in the training set where it occurs.
  
      Parameters
      ----------
      train_data
          Representative sample from the training data.
      disc_perc
          List with percentiles (`int`) used for discretization.
      """
  
      # transform one-hot encodings to labels if ohe == True
      train_data = (
          ohe_to_ord(X_ohe=train_data, cat_vars_ohe=self.cat_vars_ohe)[
              0
          ]
          if self.ohe
          else train_data
      )
  
      # discretization of continuous features
      disc = Discretizer(
          train_data,
          self.numerical_features,
          self.feature_names,
          percentiles=disc_perc,
      )
      d_train_data = disc.discretize(train_data)
      self.feature_values.update(disc.feature_intervals)
  
      sampler = TabularSampler(
          self._predictor,  # type: ignore[arg-type] # TODO: fix me, ignored as can be None due to saving.py
          disc_perc,
          self.numerical_features,
          self.categorical_features,
          self.feature_names,
          self.feature_values,
          seed=self.seed,
      )
      self.samplers = [sampler.deferred_init(train_data, d_train_data)]
  
      # update metadata
      self.meta["params"].update(disc_perc=disc_perc)
  
      self._fitted = True
  
      return self
  
imports: import copy
  from collections import OrderedDict, defaultdict
  from itertools import accumulate
  from typing import Any, Callable, DefaultDict, Dict, List, Optional, Set, Tuple, Type, Union
  import numpy
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation, FitMixin
  from alibi.exceptions import NotFittedError, PredictorCallError, PredictorReturnTypeError
  from alibi.utils.discretizer import Discretizer
  from alibi.utils.mapping import ohe_to_ord, ord_to_ohe
  from alibi.utils.wrappers import ArgmaxTransformer
  from .anchor_base import AnchorBaseBeam
  from .anchor_explanation import AnchorExplanation
label_desc: Use image node_id 2 for calling the AnchorTabular obj's underlying member method code with example usage: obj.fit(train_data, disc_perc) and returns: self