docstr: Init method
  
  :param data_interface: an interface class to access data related params.
  :param model_interface: an interface class to access trained ML model.
docstr_tok: ["Init","method",":","param","data_interface",":","an","interface","class","to","access","data","related","params",".",":","param","model_interface",":","an","interface","class","to","access","trained","ML","model","."]
code: def __init__(self, data_interface, model_interface):
      """Init method
  
      :param data_interface: an interface class to access data related params.
      :param model_interface: an interface class to access trained ML model.
  
      """
      # initiating data related parameters
      super().__init__(data_interface)
      # initializing model related variables
      self.model = model_interface
      self.model.load_model()  # loading trained model
      self.model.transformer.feed_data_params(data_interface)
      self.model.transformer.initialize_transform_func()
      # temp data to create some attributes like encoded feature names
      temp_ohe_data = self.model.transformer.transform(
          self.data_interface.data_df.iloc[[0]]
      )
      self.data_interface.create_ohe_params(temp_ohe_data)
      (
          self.minx,
          self.maxx,
          self.encoded_categorical_feature_indexes,
          self.encoded_continuous_feature_indexes,
          self.cont_minx,
          self.cont_maxx,
          self.cont_precisions,
      ) = self.data_interface.get_data_params_for_gradient_dice()
  
      # create TensorFLow session if one is not already created
      if tf.get_default_session() is not None:
          self.dice_sess = tf.get_default_session()
      else:
          self.dice_sess = tf.InteractiveSession()
  
      self.input_tensor = tf.Variable(
          self.minx, dtype=tf.float32
      )  # placeholder variables for model predictions
      self.output_tensor = self.model.get_output(self.input_tensor)
      # number of output nodes of ML model
      self.num_output_nodes = self.dice_sess.run(
          self.model.get_num_output_nodes(
              len(self.data_interface.ohe_encoded_feature_names)
          )
      ).shape[1]
  
      # hyperparameter initializations
      self.weights = []
      self.weights_inits = tf.placeholder(tf.float32, shape=())
      self.weights_assign = []
      for i in range(3):
          self.weights.append(tf.Variable(1.0, dtype=tf.float32))
          self.weights_assign.append(
              tf.assign(self.weights[i], self.weights_inits)
          )
      self.hyperparameters = (
          []
      )  # proximity_weight, diversity_weight, categorical_penalty
      self.cf_init_weights = (
          []
      )  # total_CFs, algorithm, features_to_vary
      self.loss_weights = (
          []
      )  # yloss_type, diversity_loss_type, feature_weights
      self.optimizer_weights = []
  
imports: import collections
  import copy
  import random
  import timeit
  import numpy
  import tensorflow
  from dice_ml import diverse_counterfactuals
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
label_desc: Use image node_id 1 to create a new DiceTensorFlow1 object from inherited base classes: ExplainerBase with example: obj = DiceTensorFlow1(data_interface, model_interface)