Skip to content

Instantly share code, notes, and snippets.

@xxqcheers
xxqcheers / auc.py
Created April 16, 2018 03:46 — forked from wepe/auc.py
AUC计算: 精确方法与近似方法
# coding=utf-8
# auc值的大小可以理解为: 随机抽一个正样本和一个负样本,正样本预测值比负样本大的概率
# 根据这个定义,我们可以自己实现计算auc
import random
import time
def timeit(func):
"""
装饰器计算函数执行时间