1、准确率(Accuracy)
Accuracy = (TP+TN)/(TP+FN+FP+TN)
from sklearn.metrics import accuracy_score
accuracy_score(y_true, y_pred, normalize=True, sample_weight=None)
2、精确率(Precision)
预测为正的里面有多少真正是正的概率为查准率。
Precision = TP/(TP+FP)
from sklearn.metrics import precision_score
precision_score(y_true, y_pred, labels=None, pos_label=1, average='binary')
3、召回率(Recall)
召回率表现出在实际正样本中,分类器能预测出多少。与真正率相等。
Recall = TP/(TP+FN)
from sklearn.metrics import recall_score
sklearn.metrics.recall_score(y_true, y_pred, labels=None, pos_label=1,average='binary', sample_weight=None)
4、F1 score
F1指标:2/F1 =