def f1_score_least_frequent(y_true, y_pred):
    least_frequent = np.bincount(y_true).argmin()
    return f1_score(y_true, y_pred, average=None)[least_frequent]
Calculate the F1 score of the least frequent label/class in ``y_true`` for
dataset/ETHPy150Open EducationalTestingService/skll/skll/metrics.py/f1_score_least_frequent