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, 'darkorange', lw=2, label='AUC = %.2f' % auc_area)
    plt.legend(loc='lower right')
    plt.plot([0, 1], [0, 1], 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 之绘图_第1张图片

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

[Receiver Operating Characteristic (ROC)¶]

[python sklearn画ROC曲线 ]

皮皮blog

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

ref:


你可能感兴趣的:(Scikit-Learn)