使用ptype AUC无法运行cvglmnet

时间:2019-02-26 10:41:09

标签: python glmnet

我无法在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'工作正常。

0 个答案:

没有答案