数据挖掘路上滴滴点点,记录下常用评价指标。持续更新。
Acc、f1、recall、precision
metrics_lr = {
'accuracy': accuracy_score(prediction_lr, Y_test),
'f1': f1_score(prediction_lr, Y_test, average="macro"),
'recall': recall_score(prediction_lr, Y_test, average="macro"),
'precision': precision_score(prediction_lr, Y_test, average="macro")
}
print(metrics_lr)
ROC、AUC用法
lg_y_score = lg.decision_function(X_test)
lg_fpr, lg_tpr, lg_threasholds = metrics.roc_curve(Y_test.ravel(),lg_y_score.ravel())