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: Args:
      training_data: numpy 3d array with shape
          (n_samples, n_timesteps, n_features)
      mode: "classification" or "regression"
      training_labels: labels for training data. Not required, but may be
          used by discretizer.
      feature_names: list of names (strings) corresponding to the columns
          in the training data.
      categorical_features: list of indices (ints) corresponding to the
          categorical columns. Everything else will be considered
          continuous. Values in these columns MUST be integers.
      categorical_names: map from int to list of names, where
          categorical_names[x][y] represents the name of the yth value of
          column x.
      kernel_width: kernel width for the exponential kernel.
      If None, defaults to sqrt(number of columns) * 0.75
      kernel: similarity kernel that takes euclidean distances and kernel
          width as input and outputs weights in (0,1). If None, defaults to
          an exponential kernel.
      verbose: if true, print local prediction values from linear model
      class_names: list of class names, ordered according to whatever the
          classifier is using. If not present, class names will be '0',
          '1', ...
      feature_selection: feature selection method. can be
          'forward_selection', 'lasso_path', 'none' or 'auto'.
          See function 'explain_instance_with_data' in lime_base.py for
          details on what each of the options does.
      discretize_continuous: if True, all non-categorical features will
          be discretized into quartiles.
      discretizer: only matters if discretize_continuous is True. Options
          are 'quartile', 'decile', 'entropy' or a BaseDiscretizer
          instance.
      random_state: an integer or numpy.RandomState that will be used to
          generate random numbers. If None, the random state will be
          initialized using the internal numpy seed.
docstr_tok: ["Args",":","training_data",":","numpy","3d","array","with","shape","(","n_samples",",","n_timesteps",",","n_features",")","mode",":","``","classification","''","or","``","regression","''","training_labels",":","labels","for","training","data",".","Not","required",",","but","may","be","used","by","discretizer",".","feature_names",":","list","of","names","(","strings",")","corresponding","to","the","columns","in","the","training","data",".","categorical_features",":","list","of","indices","(","ints",")","corresponding","to","the","categorical","columns",".","Everything","else","will","be","considered","continuous",".","Values","in","these","columns","MUST","be","integers",".","categorical_names",":","map","from","int","to","list","of","names",",","where","categorical_names","[","x","]","[","y","]","represents","the","name","of","the","yth","value","of","column","x.","kernel_width",":","kernel","width","for","the","exponential","kernel",".","If","None",",","defaults","to","sqrt","(","number","of","columns",")","*","0.75","kernel",":","similarity","kernel","that","takes","euclidean","distances","and","kernel","width","as","input","and","outputs","weights","in","(","0,1",")",".","If","None",",","defaults","to","an","exponential","kernel",".","verbose",":","if","true",",","print","local","prediction","values","from","linear","model","class_names",":","list","of","class","names",",","ordered","according","to","whatever","the","classifier","is","using",".","If","not","present",",","class","names","will","be","'","0","'",",","'","1","'",",","...","feature_selection",":","feature","selection","method",".","can","be","'forward_selection","'",",","'lasso_path","'",",","'none","'","or","'auto","'",".","See","function","'explain_instance_with_data","'","in","lime_base.py","for","details","on","what","each","of","the","options","does",".","discretize_continuous",":","if","True",",","all","non-categorical","features","will","be","discretized","into","quartiles",".","discretizer",":","only","matters","if","discretize_continuous","is","True",".","Options","are","'quartile","'",",","'decile","'",",","'entropy","'","or","a","BaseDiscretizer","instance",".","random_state",":","an","integer","or","numpy.RandomState","that","will","be","used","to","generate","random","numbers",".","If","None",",","the","random","state","will","be","initialized","using","the","internal","numpy","seed","."]
code: def __init__(
      self,
      training_data,
      mode="classification",
      training_labels=None,
      feature_names=None,
      categorical_features=None,
      categorical_names=None,
      kernel_width=None,
      kernel=None,
      verbose=False,
      class_names=None,
      feature_selection="auto",
      discretize_continuous=True,
      discretizer="quartile",
      random_state=None,
  ):
      """
      Args:
          training_data: numpy 3d array with shape
              (n_samples, n_timesteps, n_features)
          mode: "classification" or "regression"
          training_labels: labels for training data. Not required, but may be
              used by discretizer.
          feature_names: list of names (strings) corresponding to the columns
              in the training data.
          categorical_features: list of indices (ints) corresponding to the
              categorical columns. Everything else will be considered
              continuous. Values in these columns MUST be integers.
          categorical_names: map from int to list of names, where
              categorical_names[x][y] represents the name of the yth value of
              column x.
          kernel_width: kernel width for the exponential kernel.
          If None, defaults to sqrt(number of columns) * 0.75
          kernel: similarity kernel that takes euclidean distances and kernel
              width as input and outputs weights in (0,1). If None, defaults to
              an exponential kernel.
          verbose: if true, print local prediction values from linear model
          class_names: list of class names, ordered according to whatever the
              classifier is using. If not present, class names will be '0',
              '1', ...
          feature_selection: feature selection method. can be
              'forward_selection', 'lasso_path', 'none' or 'auto'.
              See function 'explain_instance_with_data' in lime_base.py for
              details on what each of the options does.
          discretize_continuous: if True, all non-categorical features will
              be discretized into quartiles.
          discretizer: only matters if discretize_continuous is True. Options
              are 'quartile', 'decile', 'entropy' or a BaseDiscretizer
              instance.
          random_state: an integer or numpy.RandomState that will be used to
              generate random numbers. If None, the random state will be
              initialized using the internal numpy seed.
      """
  
      # Reshape X
      n_samples, n_timesteps, n_features = training_data.shape
      training_data = np.transpose(
          training_data, axes=(0, 2, 1)
      ).reshape(n_samples, n_timesteps * n_features)
      self.n_timesteps = n_timesteps
      self.n_features = n_features
      if feature_names is None:
          feature_names = ["feature%d" % i for i in range(n_features)]
  
      # Update the feature names
      feature_names = [
          "{}_t-{}".format(n, n_timesteps - (i + 1))
          for n in feature_names
          for i in range(n_timesteps)
      ]
  
      # Send off the the super class to do its magic.
      super(RecurrentTabularExplainer, self).__init__(
          training_data,
          mode=mode,
          training_labels=training_labels,
          feature_names=feature_names,
          categorical_features=categorical_features,
          categorical_names=categorical_names,
          kernel_width=kernel_width,
          kernel=kernel,
          verbose=verbose,
          class_names=class_names,
          feature_selection=feature_selection,
          discretize_continuous=discretize_continuous,
          discretizer=discretizer,
          random_state=random_state,
      )
  
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 1 to create a new RecurrentTabularExplainer object from inherited base classes: LimeTabularExplainer with example: obj = RecurrentTabularExplainer(training_data, mode, training_labels, feature_names, categorical_features, categorical_names, kernel_width, kernel, verbose, class_names, feature_selection, discretize_continuous, discretizer, random_state)