def auc_mat(y, prob, weights = None):
if weights == None or len(weights) == 0:
weights = scipy.ones([y.shape[0], 1])
wweights = weights*y
wweights = wweights.flatten()
wweights = scipy.reshape(wweights, [1, wweights.size])
ny= y.shape[0]
a = scipy.zeros([ny, 1])
b = scipy.ones([ny, 1])
yy = scipy.vstack((a, b))
pprob = scipy.vstack((prob,prob))
result = auc(yy, pprob, wweights)
return(result)
#=========================
评论列表
文章目录