code: def calc_all_hyper_param_importance(hparams, metrics):
      results = {}
      for metric in metrics:
          for hparam in hparams:
              flattened_lineage = {
                  hparam["name"]: hparam["values"],
                  metric["name"]: metric["values"],
              }
              result = calc_hyper_param_importance(
                  pd.DataFrame(flattened_lineage),
                  hparam["name"],
                  metric["name"],
              )
              # print('%s - %s : result=' % (hparam, metric), result)
              if hparam["name"] not in results.keys():
                  results[hparam["name"]] = result
              else:
                  results[hparam["name"]] += result
      sum_score = reduce(lambda x, y: x + y, results.values())
      for key, value in results.items():
          results[key] = value / sum_score
      result = [
          {"name": key, "value": value}
          for key, value in results.items()
      ]
      return result
  
imports: from functools import reduce
  import numpy
  import pandas
  from visualdl.server.log import logger
label_desc: Use image node_id 2 for calling a global function with example usage: calc_all_hyper_param_importance(hparams, metrics) and returns: result