def generate_ap(k, p_data, index): ap_data = [] for i, fd in enumerate(p_data): ap_data.append([k[i][TYPE_COL]] + fd) calculate_ap(ap_data, index)
def generate_ap(index_name, data_to_predict, final_pred): pre_data_for_ap = [] for i, dtp in enumerate(data_to_predict): pre_data_for_ap.append([dtp[HIST_PRED_L_COL]] + final_pred[i]) return calculate_ap(pre_data_for_ap, index_name)