code: def get_training_history_suggestion(training_meta, metric):
      if (
          metric == constants.TRAIN_TEST_AUC
          or metric == constants.TRAIN_TEST_F1
      ):
          return True, None
  
      f1_scores = []
      auc_scores = []
  
      best_idx = training_meta[constants.KEY_BEST_INDEX]
      if best_idx not in training_meta[constants.KEY_HISTORY]:
          best_idx = str(best_idx)
      best_idx_f1 = training_meta[constants.KEY_HISTORY][best_idx][
          constants.KEY_HISTORY_EVALUATION
      ][constants.TRAIN_TEST_F1]
      best_idx_auc = training_meta[constants.KEY_HISTORY][best_idx][
          constants.KEY_HISTORY_EVALUATION
      ][constants.TRAIN_TEST_AUC]
      best_metric = training_meta[constants.KEY_HISTORY][best_idx][
          constants.KEY_HISTORY_EVALUATION
      ][metric]
  
      if math.isnan(best_idx_f1):
          best_idx_f1 = 0
      recommendation = []
      for iter_num, iter_eval in training_meta[
          constants.KEY_HISTORY
      ].items():
          f1 = training_meta[constants.KEY_HISTORY][iter_num][
              constants.KEY_HISTORY_EVALUATION
          ][constants.TRAIN_TEST_F1]
          if math.isnan(f1):
              continue
          diff_f1 = f1 - best_idx_f1
          f1_scores.append(diff_f1)
          auc = training_meta[constants.KEY_HISTORY][iter_num][
              constants.KEY_HISTORY_EVALUATION
          ][constants.TRAIN_TEST_AUC]
          diff_auc = auc - best_idx_auc
          auc_scores.append(diff_auc)
          diff_metric = (
              best_metric
              - training_meta[constants.KEY_HISTORY][iter_num][
                  constants.KEY_HISTORY_EVALUATION
              ][metric]
          )
          if (
              diff_f1 > constants.RECOMMEND_METRIC_DIFF_BENCHMARK
              or diff_auc > constants.RECOMMEND_METRIC_DIFF_BENCHMARK
          ):
              recommendation.append(
                  (iter_num, diff_f1, diff_auc, diff_metric)
              )
  
      if len(recommendation) > 0:
          return False, recommendation
      else:
          return True, recommendation
  
file_path: contextual-ai/xai/recommendations/recommendation.py
imports: import xai.constants
  from sklearn.metrics.pairwise import cosine_similarity
  import math
label_desc: Use image node_id 7 for calling a global function with example usage: get_training_history_suggestion(training_meta, metric) and returns: True,  None, False,  recommendation, True,  recommendation