addons icon indicating copy to clipboard operation
addons copied to clipboard

y_true not cast to one_hot if needed in f1_score metric

Open BlueskyFR opened this issue 3 years ago • 2 comments

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.

BlueskyFR avatar Feb 14 '22 23:02 BlueskyFR

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.

Aditya-Jha2002 avatar Feb 15 '22 05:02 Aditya-Jha2002

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.

Laubeee avatar Mar 01 '24 14:03 Laubeee