我无法在ptype = 'auc'
中使用cvglmnet。
我跑步时
fit = glmnet.cvglmnet(x = scipy.float64(train_mm),
y = scipy.float64(train_target),
family = 'binomial',
ptype = 'auc',
nfolds = 5)
我收到此错误消息
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
train_mm
是我的模型矩阵,包含0和1,而train_target
是我的二进制目标矢量,包含0和1。
ptype = 'deviance'
工作正常。