sklearn.metrics【指标】

【分类指标】

1.accuracy_score(y_true,y_pre) : 精度 

 

2.auc(xyreorder=False) : ROC曲线下的面积;较大的AUC代表了较好的performance

 

3.average_precision_score(y_truey_scoreaverage='macro'sample_weight=None):根据预测得分计算平均精度(AP)

 

4.brier_score_loss(y_truey_probsample_weight=Nonepos_label=None):The smaller the Brier score, the better.

 

5.confusion_matrix(y_truey_predlabels=Nonesample_weight=None):通过计算混淆矩阵来评估分类的准确性 返回混淆矩阵

 

6.f1_score(y_truey_predlabels=Nonepos_label=1average='binary'sample_weight=None): F1值

  F1 = 2 * (precision * recall) / (precision + recall) precision(查准率)=TP/(TP+FP) recall(查全率)=TP/(TP+FN)

 

7.log_loss(y_truey_predeps=1e-15normalize=Truesample_weight=Nonelabels=None):对数损耗,又称逻辑损耗或交叉熵损耗

 

8.precision_score(y_truey_predlabels=Nonepos_label=1average='binary',) :查准率或者精度; precision(查准率)=TP/(TP+FP)

 

9.recall_score(y_truey_predlabels=Nonepos_label=1average='binary'sample_weight=None):查全率 ;recall(查全率)=TP/(TP+FN)

 

10.roc_auc_score(y_truey_scoreaverage='macro'sample_weight=None):计算ROC曲线下的面积就是AUC的值,the larger the better

 

11.roc_curve(y_truey_scorepos_label=Nonesample_weight=Nonedrop_intermediate=True);计算ROC曲线的横纵坐标值,TPR,FPR

  TPR = TP/(TP+FN) = recall(真正例率,敏感度)       FPR = FP/(FP+TN)(假正例率,1-特异性)

 

【回归指标】

1.explained_variance_score(y_truey_predsample_weight=Nonemultioutput='uniform_average'):回归方差(反应自变量与因变量之间的相关程度)

 

2.mean_absolute_error(y_truey_predsample_weight=Nonemultioutput='uniform_average'):平均绝对误差

 

3.mean_squared_error(y_truey_predsample_weight=Nonemultioutput='uniform_average'):均方差

 

4.median_absolute_error(y_truey_pred)   中值绝对误差

 

5.r2_score(y_truey_predsample_weight=Nonemultioutput='uniform_average')  :R平方值

 

posted @ 2018-08-12 19:04  夜尽天已明  阅读(19246)  评论(0编辑  收藏  举报