博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sklearn.metrics.auc
阅读量:7121 次
发布时间:2019-06-28

本文共 1142 字,大约阅读时间需要 3 分钟。

AUC(area under the curve)ROC曲线下方的面积

auc(x, y, reorder=False)

    Compute Area Under the Curve (AUC) using the trapezoidal rule

    

    This is a general function, given points on a curve.  For computing the

    area under the ROC-curve, see :func:`roc_auc_score`.  For an alternative

    way to summarize a precision-recall curve, see

    :func:`average_precision_score`.

    

    Parameters

    ----------

    x : array, shape = [n]

        x coordinates.

    y : array, shape = [n]

        y coordinates.

    reorder : boolean, optional (default=False)

        If True, assume that the curve is ascending in the case of ties, as for

        an ROC curve. If the curve is non-ascending, the result will be wrong.

    

    Returns

    -------

    auc : float

    

    Examples

    --------

    >>> import numpy as np

    >>> from sklearn import metrics

    >>> y = np.array([1, 1, 2, 2])

    >>> pred = np.array([0.1, 0.4, 0.35, 0.8])

    >>> fpr, tpr, thresholds = metrics.roc_curve(y, pred, pos_label=2)

    >>> metrics.auc(fpr, tpr)

    0.75

    

    See also

    --------

    roc_auc_score : Compute the area under the ROC curve

    average_precision_score : Compute average precision from prediction scores

    precision_recall_curve :

        Compute precision-recall pairs for different probability thresholds

转载地址:http://wssel.baihongyu.com/

你可能感兴趣的文章
[Web 前端] 使用yarn代替npm作为node.js的模块管理器
查看>>
1A2B猜数字
查看>>
写好的电子邮件没了,还能找回吗?
查看>>
AQS共享锁应用之Semaphore原理
查看>>
GraphQL入门3(Mutation)
查看>>
添加评论功能
查看>>
iOS-个人开发者账号转公司开发者账号(邓白氏码申请教程)
查看>>
mosquitto简单应用
查看>>
深入FM和FFM原理与实践
查看>>
多线程-工作组模式
查看>>
微信JSAPI分享朋友圈调试经验:invalid signature签名错误排查
查看>>
react-native + teaset 实现 Tabbar
查看>>
空的OnGUI也会有gc
查看>>
JDK7与8内存参数解析与修改
查看>>
给信息安全爱好者的一封信
查看>>
谈谈你对Glide和Picasso他们的对比的优缺点
查看>>
XNginx - nginx 集群可视化管理工具
查看>>
VMware的快照和克隆总结
查看>>
高通平台如何避免误入FFBM模式
查看>>
推荐日常生活用品
查看>>