我们说我从估算器中获得了以下指标:
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
此指标的获取方式如下:
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)
如何用matplotlib绘制这种不同的aproaches性能?让我们在y轴上说出百分比,并在x上说aproach?。
答案 0 :(得分:1)
@ cel'answer是正确的。如果您的问题更多是关于如何绘制数字,seaborn
有一个名为factor plot
的内容。看一下教程here。
您可以轻松生成这样的图形(假设x轴有标签,它们是accuracy
,f1
,precision
,recall
):