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
      if hasattr(self.data_interface, "data_df"):
          temp_ohe_data = self.model.transformer.transform(
              self.data_interface.data_df.iloc[[0]]
          )
      else:
          temp_ohe_data = None
      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()
  
      # number of output nodes of ML model
      self.num_output_nodes = self.model.get_num_output_nodes(
          len(self.data_interface.ohe_encoded_feature_names)
      ).shape[1]
  
      # variables required to generate CFs - see generate_counterfactuals() for more info
      self.cfs = []
      self.features_to_vary = []
      self.cf_init_weights = (
          []
      )  # total_CFs, algorithm, features_to_vary
      self.loss_weights = (
          []
      )  # yloss_type, diversity_loss_type, feature_weights
      self.feature_weights_input = ""
      self.hyperparameters = [
          1,
          1,
          1,
      ]  # proximity_weight, diversity_weight, categorical_penalty
      self.optimizer_weights = []
  
imports: 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 DiceTensorFlow2 object from inherited base classes: ExplainerBase with example: obj = DiceTensorFlow2(data_interface, model_interface)