class_docstr: Args:
      class_names: list of strings
      feature_names: list of strings
      train_data: used to sample (bootstrap)
      categorical_names: map from integer to list of strings, names for each
          value of the categorical features. Every feature that is not in
          this map will be considered as ordinal or continuous, and thus discretized.
class_docstr_tok: ["Args",":","class_names",":","list","of","strings","feature_names",":","list","of","strings","train_data",":","used","to","sample","(","bootstrap",")","categorical_names",":","map","from","integer","to","list","of","strings",",","names","for","each","value","of","the","categorical","features",".","Every","feature","that","is","not","in","this","map","will","be","considered","as","ordinal","or","continuous",",","and","thus","discretized","."]
code: def __init__(
      self,
      class_names,
      feature_names,
      train_data,
      categorical_names={},
      discretizer="quartile",
      encoder_fn=None,
  ):
      self.min = {}
      self.max = {}
      self.disc = collections.namedtuple(
          "random_name2", ["discretize"]
      )(lambda x: x)
      self.encoder_fn = lambda x: x
      if encoder_fn is not None:
          self.encoder_fn = encoder_fn
      self.categorical_features = []
      self.feature_names = feature_names
      self.train = train_data
      self.class_names = class_names
      self.categorical_names = copy.deepcopy(categorical_names)
      if categorical_names:
          self.categorical_features = sorted(categorical_names.keys())
  
      if discretizer == "quartile":
          self.disc = lime.lime_tabular.QuartileDiscretizer(
              train_data, self.categorical_features, self.feature_names
          )
      elif discretizer == "decile":
          self.disc = lime.lime_tabular.DecileDiscretizer(
              train_data, self.categorical_features, self.feature_names
          )
      else:
          raise ValueError("Discretizer must be quartile or decile")
  
      self.ordinal_features = [
          x
          for x in range(len(feature_names))
          if x not in self.categorical_features
      ]
  
      self.d_train = self.disc.discretize(self.train)
      self.categorical_names.update(self.disc.names)
      self.categorical_features += self.ordinal_features
  
      for f in range(train_data.shape[1]):
          self.min[f] = np.min(train_data[:, f])
          self.max[f] = np.max(train_data[:, f])
  
imports: from .None import anchor_base
  from .None import anchor_explanation
  from .None import utils
  import lime
  import lime.lime_tabular
  import collections
  import sklearn
  import numpy
  import os
  import copy
  import string
  from io import open
  import json
label_desc: Use image node_id 1 to create a new AnchorTabularExplainer object from inherited base classes: object with example: obj = AnchorTabularExplainer(class_names, feature_names, train_data, categorical_names, discretizer, encoder_fn)