docstr: Parameters
  ----------
  predictor
      A callable that takes a `numpy` array of `N` data points as inputs and returns `N` outputs.
  feature_names
      List with feature names.
  categorical_names
      Dictionary where keys are feature columns and values are the categories for the feature.
  dtype
      A `numpy` scalar type that corresponds to the type of input array expected by `predictor`. This may be
      used to construct arrays of the given type to be passed through the `predictor`. For most use cases
      this argument should have no effect, but it is exposed for use with predictors that would break when
      called with an array of unsupported type.
  ohe
      Whether the categorical variables are one-hot encoded (OHE) or not. If not OHE, they are
      assumed to have ordinal encodings.
  seed
      Used to set the random number generator for repeatability purposes.
  
  Raises
  ------
  :py:class:`alibi.exceptions.PredictorCallError`
      If calling `predictor` fails at runtime.
  :py:class:`alibi.exceptions.PredictorReturnTypeError`
      If the return type of `predictor` is not `np.ndarray`.
code: def __init__(
      self,
      predictor: Callable[[np.ndarray], np.ndarray],
      feature_names: List[str],
      categorical_names: Optional[Dict[int, List[str]]] = None,
      dtype: Type[np.generic] = np.float32,
      ohe: bool = False,
      seed: Optional[int] = None,
  ) -> None:
      """
      Parameters
      ----------
      predictor
          A callable that takes a `numpy` array of `N` data points as inputs and returns `N` outputs.
      feature_names
          List with feature names.
      categorical_names
          Dictionary where keys are feature columns and values are the categories for the feature.
      dtype
          A `numpy` scalar type that corresponds to the type of input array expected by `predictor`. This may be
          used to construct arrays of the given type to be passed through the `predictor`. For most use cases
          this argument should have no effect, but it is exposed for use with predictors that would break when
          called with an array of unsupported type.
      ohe
          Whether the categorical variables are one-hot encoded (OHE) or not. If not OHE, they are
          assumed to have ordinal encodings.
      seed
          Used to set the random number generator for repeatability purposes.
  
      Raises
      ------
      :py:class:`alibi.exceptions.PredictorCallError`
          If calling `predictor` fails at runtime.
      :py:class:`alibi.exceptions.PredictorReturnTypeError`
          If the return type of `predictor` is not `np.ndarray`.
      """
      super().__init__(meta=copy.deepcopy(DEFAULT_META_ANCHOR))
  
      self.ohe = ohe
      self.feature_names = feature_names
  
      if ohe and categorical_names:
          self.cat_vars_ord = {
              col: len(values)
              for col, values in categorical_names.items()
          }
          self.cat_vars_ohe = ord_to_ohe(
              np.zeros((1, len(feature_names))), self.cat_vars_ord
          )[1]
  
      self.dtype = dtype
      # defines self._predictor which expect label categorical features, and if ohe == True,
      # it defines self._ohe_predictor which expects one-hot encoded categorical features
      self.predictor = predictor
  
      # define column indices of categorical and numerical (aka continuous) features
      if categorical_names:
          self.categorical_features = sorted(categorical_names.keys())
          self.feature_values = (
              categorical_names.copy()
          )  # dict with {col: categorical feature values}
  
      else:
          self.categorical_features = []
          self.feature_values = {}
  
      self.numerical_features = [
          x
          for x in range(len(feature_names))
          if x not in self.categorical_features
      ]
  
      self.samplers: list = []
      self.ohe = ohe
      self.seed = seed
  
      # update metadata
      self.meta["params"].update(seed=seed)
  
      self._fitted = False
  
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 1 to create a new AnchorTabular object from inherited base classes: Explainer, FitMixin with example: obj = AnchorTabular(predictor, feature_names, categorical_names, dtype, ohe, seed)