#NEWLINE# def f1_score_least_frequent( y_true , y_pred ) : #NEWLINE# #INDENT# '\n    Calculate the F1 score of the least frequent label/class in ``y_true`` for\n    ``y_pred``.\n\n    :param y_true: The true/actual/gold labels for the data.\n    :type y_true: array-like of float\n    :param y_pred: The predicted/observed labels for the data.\n    :type y_pred: array-like of float\n\n    :returns: F1 score of the least frequent label\n    ' #NEWLINE# least_frequent = np . bincount ( y_true ) . argmin ( ) #NEWLINE# return f1_score ( least_frequent , y_pred , average = None ) [ least_frequent ]