-
I'm trying to build a multi-class text classification model using a Keras Sequential API with an LSTM layer, but I'm encountering a Here is the code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Have to cast y_true to float to match y_pred and then one-hot encode the predicted classes, and then you can calculate tp, fp, and fn
|
Beta Was this translation helpful? Give feedback.
-
I tested this and it's fine. Thanks for your help |
Beta Was this translation helpful? Give feedback.
Have to cast y_true to float to match y_pred and then one-hot encode the predicted classes, and then you can calculate tp, fp, and fn
Here is the f1_score_metric function: