一、分类评估指标:
1.二分类评估方式:包含召回率、精确率
from sklearn.metrics import accuracy_score
from sklearn.metrics import recall_score
from sklearn.metrics import precision_score
print ("准确率为:" ,accuracy_score(y_test, y_predict))
print ("召回率为:" ,recall_score(y_test, y_predict, average='macro'))
print ("精确率为:" ,precision_score(y_test, y_predict, average='macro'))
1.1 准确率:
1.2 召回率:
1.3 精确率:
2.多分类评估方式:
from sklearn.metrics import classification_report
print(classification_report(y_true, y_pred))
建立一个显示主要分类指标的文本报告。
二、聚类评估指标:
标签:方式,模型,metrics,score,print,import,评估,sklearn
From: https://www.cnblogs.com/sdbt/p/16890269.html