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 to_explanation_map(self, exp):
      def jsonize(x):
          return json.dumps(x)
  
      instance = exp["instance"]
      predicted_label = exp["prediction"]
      predict_proba = np.zeros(len(self.class_names))
      predict_proba[predicted_label] = 1
  
      examples_obj = []
      for i, temp in enumerate(exp["examples"], start=1):
          features_in_anchor = set(exp["feature"][:i])
          ret = {}
          ret["coveredFalse"] = self.transform_to_examples(
              temp["covered_false"], features_in_anchor, predicted_label
          )
          ret["coveredTrue"] = self.transform_to_examples(
              temp["covered_true"], features_in_anchor, predicted_label
          )
          ret["uncoveredTrue"] = self.transform_to_examples(
              temp["uncovered_true"],
              features_in_anchor,
              predicted_label,
          )
          ret["uncoveredFalse"] = self.transform_to_examples(
              temp["uncovered_false"],
              features_in_anchor,
              predicted_label,
          )
          ret["covered"] = self.transform_to_examples(
              temp["covered"], features_in_anchor, predicted_label
          )
          examples_obj.append(ret)
  
      explanation = {
          "names": exp["names"],
          "certainties": exp["precision"]
          if len(exp["precision"])
          else [exp["all_precision"]],
          "supports": exp["coverage"],
          "allPrecision": exp["all_precision"],
          "examples": examples_obj,
          "onlyShowActive": False,
      }
      weights = [-1 for x in range(instance.shape[0])]
      instance = self.disc.discretize(exp["instance"].reshape(1, -1))[0]
      values = [
          self.categorical_names[i][int(instance[i])]
          if i in self.categorical_features
          else instance[i]
          for i in range(instance.shape[0])
      ]
      raw_data = list(zip(self.feature_names, values, weights))
      ret = {
          "explanation": explanation,
          "rawData": raw_data,
          "predictProba": list(predict_proba),
          "labelNames": list(map(str, self.class_names)),
          "rawDataType": "tabular",
          "explanationType": "anchor",
          "trueClass": False,
      }
      return ret
  
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 4 for calling the AnchorTabularExplainer obj's underlying member method code with example usage: obj.to_explanation_map(exp) and returns: ret, json