def score_pw20(y_true, y_pred):
    """Custom metric function for PW20"""
    patients_in_20 = 0
    for i in range(len(y_true)):
        if 0.8 * y_true[i] < y_pred[i] < 1.2 * y_true[i]:
            patients_in_20 += 1
    return float(100 * patients_in_20 / len(y_true))
