code: def test_lime_explainer_with_data_stats(self):
      np.random.seed(1)
  
      rf = RandomForestClassifier(n_estimators=500)
      rf.fit(self.train, self.labels_train)
      i = np.random.randint(0, self.test.shape[0])
  
      # Generate stats using a quartile descritizer
      descritizer = QuartileDiscretizer(
          self.train,
          [],
          self.feature_names,
          self.target_names,
          random_state=20,
      )
  
      d_means = descritizer.means
      d_stds = descritizer.stds
      d_mins = descritizer.mins
      d_maxs = descritizer.maxs
      d_bins = descritizer.bins(self.train, self.target_names)
  
      # Compute feature values and frequencies of all columns
      cat_features = np.arange(self.train.shape[1])
      discretized_training_data = descritizer.discretize(self.train)
  
      feature_values = {}
      feature_frequencies = {}
      for feature in cat_features:
          column = discretized_training_data[:, feature]
          feature_count = collections.Counter(column)
          values, frequencies = map(list, zip(*(feature_count.items())))
          feature_values[feature] = values
          feature_frequencies[feature] = frequencies
  
      # Convert bins to list from array
      d_bins_revised = {}
      index = 0
      for bin in d_bins:
          d_bins_revised[index] = bin.tolist()
          index = index + 1
  
      # Descritized stats
      data_stats = {}
      data_stats["means"] = d_means
      data_stats["stds"] = d_stds
      data_stats["maxs"] = d_maxs
      data_stats["mins"] = d_mins
      data_stats["bins"] = d_bins_revised
      data_stats["feature_values"] = feature_values
      data_stats["feature_frequencies"] = feature_frequencies
  
      data = np.zeros((2, len(self.feature_names)))
      explainer = LimeTabularExplainer(
          data,
          feature_names=self.feature_names,
          random_state=10,
          training_data_stats=data_stats,
          training_labels=self.target_names,
      )
  
      exp = explainer.explain_instance(
          self.test[i],
          rf.predict_proba,
          num_features=2,
          model_regressor=LinearRegression(),
      )
  
      self.assertIsNotNone(exp)
      keys = [x[0] for x in exp.as_list()]
      self.assertEqual(
          1,
          sum([1 if "petal width" in x else 0 for x in keys]),
          "Petal Width is a major feature",
      )
      self.assertEqual(
          1,
          sum([1 if "petal length" in x else 0 for x in keys]),
          "Petal Length is a major feature",
      )
  
imports: import unittest
  import numpy
  import collections
  import sklearn
  import sklearn.datasets
  import sklearn.ensemble
  import sklearn.linear_model
  from numpy.testing import assert_array_equal
  from sklearn.datasets import load_iris, make_classification, make_multilabel_classification
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LinearRegression
  from lime.discretize import QuartileDiscretizer, DecileDiscretizer, EntropyDiscretizer
  from lime.lime_tabular import LimeTabularExplainer
label_desc: Use image node_id 11 for calling the TestLimeTabular obj's underlying member method code with example usage: obj.test_lime_explainer_with_data_stats() without return types