def top_k_regression_overlap_score(pred_list, truth_list, k):
    """
    Computes the percentage of the predicted top-k values that overlaps the truth top-k values
    """
    ranked_truth_list = [(i, val) for i, val in enumerate(truth_list)]
    ranked_truth_list.sort(key=lambda t: t[1], reverse=True)
    top_k_truth_ids = set([i for i, v in ranked_truth_list][:k])
    ranked_pred_list = [(i, val) for i, val in enumerate(pred_list)]
    ranked_pred_list.sort(key=lambda t: t[1], reverse=True)
    top_k_pred_ids = set([i for i, v in ranked_pred_list][:k])
    return len(top_k_truth_ids.intersection(top_k_pred_ids)) * 1. / k