Difference Between Performance Scores
I need some help to understand the meaning between these different scores. Currently, I am doing the classification problems using machine learning, and I have obtained the results for the classification as shown in the image below.
To obtain the results like in the image I use the code:
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
print(confusion_matrix(y_test,y_pred))
print(accuracy_score(y_test,y_pred))
print(classification_report(y_test, y_pred))
Then I also try to use the code below to get the recall, precision and f1-score
print(precision_score(y_test,y_pred))
print(recall_score(y_test,y_pred))
print(f1_score(y_test,y_pred))
Results :
Precision : 0.19601
Recall : 0.44360
F1-score : 0.27188
Then I also try this code for weighted using this code:
print(precision_score(y_test,y_pred, average='weighted'))
print(recall_score(y_test,y_pred, average='weighted'))
print(f1_score(y_test,y_pred, average='weighted'))
Results :
Weighted Precision : 0.8588
Weighted Recall : 0.7684
Weighted F1-score : 0.8048
The problem right now is I already confuse with all these values. What does the meaning of avg/total value in the image, the values of the second code I try, and the value of the weighted metrics as my third code. Which value that I should use to know that the performance of the classifier is good or not ? Hope someone can help me.
Topic performance machine-learning
Category Data Science