Created
November 12, 2018 11:00
-
-
Save debonx/98aca4c9c011b7ce74262bd315033690 to your computer and use it in GitHub Desktop.
Analyse the predictive power of your algorithm with Scikit-Learn. More at https://scikit-learn.org/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import accuracy_score, recall_score, precision_score, f1_score | |
#True labels and predicted classifications | |
labels = [1, 0, 0, 1, 1, 1, 0, 1, 1, 1] | |
guesses = [0, 1, 1, 1, 1, 0, 1, 0, 1, 0] | |
#Calculate accuracy, recall, precision and f1 score | |
print(accuracy_score(labels, guesses)) | |
print(recall_score(labels, guesses)) | |
print(precision_score(labels, guesses)) | |
print(f1_score(labels, guesses)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment