Skip to content

Instantly share code, notes, and snippets.

View wepe's full-sized avatar
:electron:
Focusing

wepon wepe

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

###1. 自定义激活函数

可以采用以下几种方法:

from keras import backend as K
from keras.layers.core import Lambda
from keras.engine import Layer