Scikit-learn:模型评估Model evaluation 之绘图

时间:2023-03-09 17:45:15
Scikit-learn:模型评估Model evaluation 之绘图

http://blog.csdn.net/pipisorry/article/details/53001866

绘制ROC曲线

def plotRUC(yt, ys, title=None):
    '''
    绘制ROC-AUC曲线
    :param yt: y真值
    :param ys: y预测值
    '''
    from sklearn import metrics
    from matplotlib import pyplot as plt
    f_pos, t_pos, thresh = metrics.roc_curve(yt, ys)
    auc_area = metrics.auc(f_pos, t_pos)

    plt.plot(f_pos, t_pos, , label='AUC = %.2f' % auc_area)
    plt.legend(loc='lower right')
    plt.plot([, ], [, ], color='navy', linestyle='--')
    plt.title('ROC-AUC curve for %s' % title)
    plt.ylabel('True Pos Rate')
    plt.xlabel('False Pos Rate')
    plt.show()

Scikit-learn:模型评估Model evaluation 之绘图

[机器学习模型的评价指标和方法]

[Receiver Operating Characteristic (ROC)¶]

[python sklearn画ROC曲线]

皮皮blog

from: http://blog.csdn.net/pipisorry/article/details/53001866

ref: