docstr: Provides Explanations of CoFrNet Model
  
  Args:
  explain_mode: either "importances" or "print_co_fr", will raise exception if not one of these two options
  max_layer_num: For "print_co_fr": Choose Depth of Ladder to Show, Default 10
  var_num: For "print_co_fr": Variable (index of input feature) for Which to Display Ladder, Default 6
docstr_tok: ["Provides","Explanations","of","CoFrNet","Model","Args",":","explain_mode",":","either","``","importances","''","or","``","print_co_fr","''",",","will","raise","exception","if","not","one","of","these","two","options","max_layer_num",":","For","``","print_co_fr","''",":","Choose","Depth","of","Ladder","to","Show",",","Default","10","var_num",":","For","``","print_co_fr","''",":","Variable","(","index","of","input","feature",")","for","Which","to","Display","Ladder",",","Default","6"]
code: def explain(self, explain_mode, max_layer_num=10, var_num=6):
      """
      Provides Explanations of CoFrNet Model
  
      Args:
      explain_mode: either "importances" or "print_co_fr", will raise exception if not one of these two options
      max_layer_num: For "print_co_fr": Choose Depth of Ladder to Show, Default 10
      var_num: For "print_co_fr": Variable (index of input feature) for Which to Display Ladder, Default 6
      """
  
      def importances(self):
          final_layer_weights = vars(self.model.layers[-1])[
              "_parameters"
          ]["weight"].data.numpy()
          weights_by_node = final_layer_weights.T
          averaged = np.average(weights_by_node, axis=1)
          copy_averaged = averaged.copy()
          print(copy_averaged)
          num_important_to_print = 3
          for x in range(0, num_important_to_print):
              min_idx = np.argmax(copy_averaged)
              print(
                  "The number "
                  + str(x + 1)
                  + " most important input feature was the "
                  + str(min_idx + 1)
                  + "th one."
              )
              copy_averaged[np.argmax(copy_averaged)] = copy_averaged[
                  np.argmin(copy_averaged)
              ]
              # print(vars(self.model.layers[-1])['_parameters']['weight'].data.numpy().T)
  
      def print_co_fr(self, max_layer_num=10, var_num=6):
          # max_layer_num = chosen depth of ladder to show (10 layers, index would be 9)
          # var_num = variable for which to display ladder
          thingToPrint = ""
          for layerNum in range(0, max_layer_num - 1):
              temp = vars(self.model.layers[layerNum])
              print()
              print("LayerNum: ", layerNum)
              val = (
                  temp["_parameters"]["weight"].data[var_num][var_num]
              ).numpy()
              print("Val: ", val)
              bias = temp["_parameters"]["bias"].data[var_num].numpy()
              print("Bias: ", bias)
              if bias > (0.01 * val):
                  print(str(bias))
                  combined = "(" + str(val) + "*x + " + str(bias) + ")"
                  print("Combined: ", combined)
              else:
                  print("hi")
                  combined = "(" + str(val) + "*x" + "+0)"
                  print("Combined: ", combined)
              print()
              thingToPrint = (
                  "1/(" + combined + " + (" + thingToPrint + "))"
              )
  
          print(thingToPrint)
          return thingToPrint
  
      if explain_mode == "importances":
          importances()
      elif explain_mode == "print_co_fr":
          print_co_fr(max_layer_num, var_num)
      else:
          raise Exception(
              "explain_mode must be either 'importances' or 'print_co_fr'"
          )
  
imports: import sys
  import pandas
  import numpy
  import torch
  import torch.nn
  from torch.autograd import Function
  from torch.nn.parameter import Parameter
  import torch.nn.functional
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.model_selection import train_test_split
  from aix360.algorithms.cofrnet.utils import generate_connections
  from aix360.algorithms.cofrnet.utils import process_data
  from aix360.algorithms.cofrnet.CustomizedLinearClasses import CustomizedLinearFunction
  from aix360.algorithms.cofrnet.CustomizedLinearClasses import CustomizedLinear
  from aix360.algorithms.die import DIExplainer
label_desc: Use image node_id 4 for calling the CoFrNet_Explainer obj's underlying member method code with example usage: obj.explain(explain_mode, max_layer_num, var_num) and returns: thingToPrint