Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please, How to print F1-score and recall etc. #190

Open
mahaibin97 opened this issue Apr 5, 2020 · 3 comments
Open

Please, How to print F1-score and recall etc. #190

mahaibin97 opened this issue Apr 5, 2020 · 3 comments

Comments

@mahaibin97
Copy link

i wnat to print F1-score, recall, acc etc, how to change code?

@AnuragNagare
Copy link

I have updated the eval.py to print the f1 score , recall and accuracy .
this is the part that will print it

'''
if y_test is not None:
correct_predictions = float(sum(all_predictions == y_test))
total_predictions = len(y_test)
accuracy = correct_predictions / total_predictions
f1 = f1_score(y_test, all_predictions, average='weighted')
recall = recall_score(y_test, all_predictions, average='weighted')

print("Total number of test examples: {}".format(total_predictions))
print("Accuracy: {:g}".format(accuracy))
print("F1 Score: {:g}".format(f1))
print("Recall: {:g}".format(recall))

'''

@liangtingStduy
Copy link

liangtingStduy commented Oct 6, 2023 via email

@xuqiangxq
Copy link

xuqiangxq commented Oct 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants