class_docstr: Tranformer for converting aif360 dataset to LIME dataset and vice versa.
  
  (LIME - Local Interpretable Model-Agnostic Explanations) [2]_
  
  See for details/usage:
  https://github.com/marcotcr/lime
  
  References:
      .. [2] M.T. Ribeiro, S. Singh, and C. Guestrin, '"Why should I trust
         you?" Explaining the predictions of any classifier.'
         https://arxiv.org/pdf/1602.04938v1.pdf
docstr: Take an aif360 dataset and save all relevant metadata as well as
  mappings needed to transform/inverse_transform the data between aif360
  and lime.
  
  Args:
      dataset (BinaryLabelDataset): aif360 dataset
  
  Returns:
      LimeEncoder: Returns self.
code: def fit(self, dataset):
      """Take an aif360 dataset and save all relevant metadata as well as
      mappings needed to transform/inverse_transform the data between aif360
      and lime.
  
      Args:
          dataset (BinaryLabelDataset): aif360 dataset
  
      Returns:
          LimeEncoder: Returns self.
      """
      self.s_feature_names_with_one_hot_encoding = dataset.feature_names
      df, df_dict = dataset.convert_to_dataframe(de_dummy_code=True)
  
      dfc = df.drop(
          dataset.label_names[0], axis=1
      )  # remove label (class) column
  
      self.s_feature_names = list(
          dfc.columns
      )  # create list of feature names
      self.s_data = dfc.values  # create array of feature values
  
      # since categorical features are 1-hot-encoded and their names changed,
      # the set diff gives us the list of categorical features as non-
      # categorical feature names are not changed
      self.s_categorical_features = list(
          set(self.s_feature_names)
          - set(self.s_feature_names_with_one_hot_encoding)
      )
  
      self.s_protected_attribute_names = (
          dataset.protected_attribute_names
      )
  
      # add protected attribute names to the list of categorical features
      self.s_categorical_features = (
          self.s_categorical_features + self.s_protected_attribute_names
      )
  
      self.s_labels = df[dataset.label_names[0]]  # create labels
  
      # following 3 lines are not really needed
      # using to create s_class_names..can do so manually as well ...array([ 0.,  1.])
      s_le = sklearn.preprocessing.LabelEncoder()
      s_le.fit(self.s_labels)
      # self.s_labels = s_le.transform(self.s_labels)
      self.s_class_names = s_le.classes_
  
      # convert s_categorical_features to a list of array indexes in
      # s_feature_names corresponding to categorical features
      # (NOTE - does not included protected attributes)
      self.s_categorical_features = [
          self.s_feature_names.index(x)
          for x in self.s_categorical_features
      ]
  
      # map all the categorical features to numerical values and store the
      # mappings in s_categorical_names
      self.s_categorical_names = {}
      for feature in self.s_categorical_features:
          self.le = sklearn.preprocessing.LabelEncoder()
          self.le.fit(self.s_data[:, feature])
          # self.s_data[:, feature] = le.transform(self.s_data[:, feature])
          self.s_categorical_names[feature] = self.le.classes_
  
      return self
  
file_path: AIF360/aif360/datasets/lime_encoder.py
imports: import sklearn.preprocessing
  import numpy
  from aif360.algorithms import Transformer
label_desc: Use image node_id 2 for calling the LimeEncoder obj's underlying member method code with example usage: obj.fit(dataset) and returns: self