class_docstr: An explainer for keras-style recurrent neural networks, where the
  input shape is (n_samples, n_timesteps, n_features). This class
  just extends the LimeTabularExplainer class and reshapes the training
  data and feature names such that they become something like
  
  (val1_t1, val1_t2, val1_t3, ..., val2_t1, ..., valn_tn)
  
  Each of the methods that take data reshape it appropriately,
  so you can pass in the training/testing data exactly as you
  would to the recurrent neural network.
class_docstr_tok: ["An","explainer","for","keras-style","recurrent","neural","networks",",","where","the","input","shape","is","(","n_samples",",","n_timesteps",",","n_features",")",".","This","class","just","extends","the","LimeTabularExplainer","class","and","reshapes","the","training","data","and","feature","names","such","that","they","become","something","like","(","val1_t1",",","val1_t2",",","val1_t3",",","...",",","val2_t1",",","...",",","valn_tn",")","Each","of","the","methods","that","take","data","reshape","it","appropriately",",","so","you","can","pass","in","the","training\/testing","data","exactly","as","you","would","to","the","recurrent","neural","network","."]
docstr: Generates explanations for a prediction.
  
  First, we generate neighborhood data by randomly perturbing features
  from the instance (see __data_inverse). We then learn locally weighted
  linear models on this neighborhood data to explain each of the classes
  in an interpretable way (see lime_base.py).
  
  Args:
      data_row: 2d numpy array, corresponding to a row
      classifier_fn: classifier prediction probability function, which
          takes a numpy array and outputs prediction probabilities. For
          ScikitClassifiers , this is classifier.predict_proba.
      labels: iterable with labels to be explained.
      top_labels: if not None, ignore labels and produce explanations for
          the K labels with highest prediction probabilities, where K is
          this parameter.
      num_features: maximum number of features present in explanation
      num_samples: size of the neighborhood to learn the linear model
      distance_metric: the distance metric to use for weights.
      model_regressor: sklearn regressor to use in explanation. Defaults
          to Ridge regression in LimeBase. Must have
          model_regressor.coef_ and 'sample_weight' as a parameter
          to model_regressor.fit()
  
  Returns:
      An Explanation object (see explanation.py) with the corresponding
      explanations.
docstr_tok: ["Generates","explanations","for","a","prediction",".","First",",","we","generate","neighborhood","data","by","randomly","perturbing","features","from","the","instance","(","see","__data_inverse",")",".","We","then","learn","locally","weighted","linear","models","on","this","neighborhood","data","to","explain","each","of","the","classes","in","an","interpretable","way","(","see","lime_base.py",")",".","Args",":","data_row",":","2d","numpy","array",",","corresponding","to","a","row","classifier_fn",":","classifier","prediction","probability","function",",","which","takes","a","numpy","array","and","outputs","prediction","probabilities",".","For","ScikitClassifiers",",","this","is","classifier.predict_proba",".","labels",":","iterable","with","labels","to","be","explained",".","top_labels",":","if","not","None",",","ignore","labels","and","produce","explanations","for","the","K","labels","with","highest","prediction","probabilities",",","where","K","is","this","parameter",".","num_features",":","maximum","number","of","features","present","in","explanation","num_samples",":","size","of","the","neighborhood","to","learn","the","linear","model","distance_metric",":","the","distance","metric","to","use","for","weights",".","model_regressor",":","sklearn","regressor","to","use","in","explanation",".","Defaults","to","Ridge","regression","in","LimeBase",".","Must","have","model_regressor.coef_","and","'sample_weight","'","as","a","parameter","to","model_regressor.fit","(",")","Returns",":","An","Explanation","object","(","see","explanation.py",")","with","the","corresponding","explanations","."]
code: def explain_instance(
      self,
      data_row,
      classifier_fn,
      labels=(1,),
      top_labels=None,
      num_features=10,
      num_samples=5000,
      distance_metric="euclidean",
      model_regressor=None,
  ):
      """Generates explanations for a prediction.
  
      First, we generate neighborhood data by randomly perturbing features
      from the instance (see __data_inverse). We then learn locally weighted
      linear models on this neighborhood data to explain each of the classes
      in an interpretable way (see lime_base.py).
  
      Args:
          data_row: 2d numpy array, corresponding to a row
          classifier_fn: classifier prediction probability function, which
              takes a numpy array and outputs prediction probabilities. For
              ScikitClassifiers , this is classifier.predict_proba.
          labels: iterable with labels to be explained.
          top_labels: if not None, ignore labels and produce explanations for
              the K labels with highest prediction probabilities, where K is
              this parameter.
          num_features: maximum number of features present in explanation
          num_samples: size of the neighborhood to learn the linear model
          distance_metric: the distance metric to use for weights.
          model_regressor: sklearn regressor to use in explanation. Defaults
              to Ridge regression in LimeBase. Must have
              model_regressor.coef_ and 'sample_weight' as a parameter
              to model_regressor.fit()
  
      Returns:
          An Explanation object (see explanation.py) with the corresponding
          explanations.
      """
  
      # Flatten input so that the normal explainer can handle it
      data_row = data_row.T.reshape(self.n_timesteps * self.n_features)
  
      # Wrap the classifier to reshape input
      classifier_fn = self._make_predict_proba(classifier_fn)
      return super(RecurrentTabularExplainer, self).explain_instance(
          data_row,
          classifier_fn,
          labels=labels,
          top_labels=top_labels,
          num_features=num_features,
          num_samples=num_samples,
          distance_metric=distance_metric,
          model_regressor=model_regressor,
      )
  
imports: import collections
  import copy
  from functools import partial
  import json
  import warnings
  import numpy
  import scipy
  import sklearn
  import sklearn.preprocessing
  from sklearn.utils import check_random_state
  from pyDOE2 import lhs
  from scipy.stats.distributions import norm
  from lime.discretize import QuartileDiscretizer
  from lime.discretize import DecileDiscretizer
  from lime.discretize import EntropyDiscretizer
  from lime.discretize import BaseDiscretizer
  from lime.discretize import StatsDiscretizer
  from .None import explanation
  from .None import lime_base
label_desc: Use image node_id 3 for calling the RecurrentTabularExplainer obj's underlying member method code with example usage: obj.explain_instance(data_row, classifier_fn, labels, top_labels, num_features, num_samples, distance_metric, model_regressor) and returns: super