sklearn.metrics.auc

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

优秀的个人博客,低调大师

微信关注我们

原文链接:https://yq.aliyun.com/articles/423645

转载内容版权归作者及来源网站所有!

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

相关文章

发表评论

资源下载

更多资源
Mario,低调大师唯一一个Java游戏作品

Mario,低调大师唯一一个Java游戏作品

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Oracle Database,又名Oracle RDBMS

Oracle Database,又名Oracle RDBMS

Oracle Database,又名Oracle RDBMS,或简称Oracle。是甲骨文公司的一款关系数据库管理系统。它是在数据库领域一直处于领先地位的产品。可以说Oracle数据库系统是目前世界上流行的关系数据库管理系统,系统可移植性好、使用方便、功能强,适用于各类大、中、小、微机环境。它是一种高效率、可靠性好的、适应高吞吐量的数据库方案。

Java Development Kit(Java开发工具)

Java Development Kit(Java开发工具)

JDK是 Java 语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。JDK是整个java开发的核心,它包含了JAVA的运行环境(JVM+Java系统类库)和JAVA工具。

Sublime Text 一个代码编辑器

Sublime Text 一个代码编辑器

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。