简体   繁体   中英

How to plot performance percentages using percentage on y axis and each metric on x axis?

Let's say I have the following metrics which I obtained from an estimator:

aproach 1:

Accuracy: 0.492307692308
score: 0.492307692308
precision: 0.368678121457
recall: 0.492307692308
hamming loss: 0.0536130536131
Jaccard similarity: 0.946386946387
F-Beta Score: 0.902376921174

aproach 2:

Accuracy: 0.07692308
score: 0.307692308
precision: 0.8678121457
recall: 0.492307692308
hamming loss: 0.0536130536131
Jaccard similarity: 0.946386946387
F-Beta Score: 0.902376921174

aproach 3:

Accuracy: 0.432307692308
score: 0.412307692308
precision: 0.68678121457
recall: 0.2307692308
hamming loss: 0.0536130536131
Jaccard similarity: 0.946386946387
F-Beta Score: 0.902376921174

This metrics where obtained like this:

from sklearn.metrics.metrics import precision_score, recall_score, confusion_matrix, classification_report, accuracy_score, roc_auc_score, auc
print '\nAccuracy:', accuracy_score(y_test, prediction)
print '\nscore:', classifier.score(testing_matrix, y_test)
print '\nprecision:', precision_score(y_test, prediction)
print '\nrecall:', recall_score(y_test, prediction)
print 'Hamming loss:',hamming_loss(y_test,prediction)
print 'Jaccard similarity:',jaccard_similarity_score(y_test,prediction)
print 'F-Beta Score:',fbeta_score(y_test, prediction, average='macro', beta=0.5)

How can I plot this different aproaches performance with matplotlib?. Let's say on the y axis the percentage and on the x the aproach?.

@cel'answer is the correct one if you want to know what to plot. If your question is more about how to plot your numbers, seaborn has something called factor plot . Have a look at the tutorial here .

You can easily produce a graph like this (pretend the x axis has labels, and they are accuracy , f1 , precision , recall ): 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM