|
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: |
Answered by
Mariihmp
Aug 18, 2025
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 |
0 replies
Answer selected by
spacyuj
|
I tested this and it's fine. Thanks for your help |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: