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

Evaluate training and testing metrics using mAP (mean average precision) for imblanced data #16

Open
aboelkassem opened this issue Feb 18, 2022 · 2 comments

Comments

@aboelkassem
Copy link
Member

  • you can use mAP on our data by using this example
@aboelkassem aboelkassem self-assigned this Feb 25, 2022
@aboelkassem
Copy link
Member Author

aboelkassem commented Feb 25, 2022

sklearn

# predict probabilities for test set
yhat_probs = model.predict(testX, verbose=1)
# predict crisp classes for test set
yhat_classes = model.predict_classes(testX, verbose=1)

# accuracy: (tp + tn) / (p + n)
accuracy = accuracy_score(testy, yhat_classes)
print('Accuracy: %f' % accuracy)
# precision tp / (tp + fp)
precision = precision_score(testy, yhat_classes)
print('Precision: %f' % precision)
# recall: tp / (tp + fn)
recall = recall_score(testy, yhat_classes)
print('Recall: %f' % recall)
# f1: 2 tp / (2 tp + fp + fn)
f1 = f1_score(testy, yhat_classes)
print('F1 score: %f' % f1)

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

No branches or pull requests

1 participant