addons
addons copied to clipboard
y_true not cast to one_hot if needed in f1_score metric
Hi!
As per this line, if y_true is not under the one_hot form (i.e. an integer), the call will fail, so it must be converted to one_hot encoding if needed before.
Hey maintainers. Can this issue be assigned to me. I am thinking of adding a check here to see if the y_true in one_hot encoded. If not then it will convert to one_hot encoding.
as TFA is not adding new features - is there any chance this will make it into keras? It kind of surprises me that somthing obvious like this is not part of keras core..
Edit: is seems it IS, its just missing in https://keras.io/api/metrics/accuracy_metrics/#binaryaccuracy-class - my bad. See https://www.tensorflow.org/api_docs/python/tf/keras/metrics/F1Score
unfortunately it does not state what version made this available.