class_docstr: A sampler that uses an underlying training set to draw records that have a subset of features with
  values specified in an instance to be explained, `X`. 
class_docstr_tok: ["A","sampler","that","uses","an","underlying","training","set","to","draw","records","that","have","a","subset","of","features","with","values","specified","in","an","instance","to","be","explained",",","`","X","`","."]
docstr: Parameters
  ----------
  predictor
      A callable that takes a tensor of `N` data points as inputs and returns `N` outputs.
  disc_perc
      Percentiles used for numerical feature discretisation.
  numerical_features
      Numerical features column IDs.
  categorical_features
      Categorical features column IDs.
  feature_names
      Feature names.
  feature_values
      Key: categorical feature column ID, value: values for the feature.
  n_covered_ex
      For each result, a number of samples where the prediction agrees/disagrees
      with the prediction on instance to be explained are stored.
  seed
      If set, fixes the random number sequence.
code: def __init__(
      self,
      predictor: Callable,
      disc_perc: Tuple[Union[int, float], ...],
      numerical_features: List[int],
      categorical_features: List[int],
      feature_names: list,
      feature_values: dict,
      n_covered_ex: int = 10,
      seed: Optional[int] = None,
  ) -> None:
      """
      Parameters
      ----------
      predictor
          A callable that takes a tensor of `N` data points as inputs and returns `N` outputs.
      disc_perc
          Percentiles used for numerical feature discretisation.
      numerical_features
          Numerical features column IDs.
      categorical_features
          Categorical features column IDs.
      feature_names
          Feature names.
      feature_values
          Key: categorical feature column ID, value: values for the feature.
      n_covered_ex
          For each result, a number of samples where the prediction agrees/disagrees
          with the prediction on instance to be explained are stored.
      seed
          If set, fixes the random number sequence.
      """
  
      np.random.seed(seed)
  
      self.predictor = predictor
      self.n_covered_ex = n_covered_ex
  
      self.numerical_features = numerical_features
      self.disc_perc = disc_perc
      self.feature_names = feature_names
      self.categorical_features = categorical_features
      self.feature_values = feature_values
  
      self.val2idx: Dict[int, DefaultDict[int, Any]] = {}
      self.cat_lookup: Dict[int, int] = {}
      self.ord_lookup: Dict[int, set] = {}
      self.enc2feat_idx: Dict[int, int] = {}
  
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 TabularSampler object  with example: obj = TabularSampler(predictor, disc_perc, numerical_features, categorical_features, feature_names, feature_values, n_covered_ex, seed)