【发布时间】:2014-07-07 09:03:27
【问题描述】:
> cv.ctrl <- trainControl(method = "repeatedcv", repeats = 3,
+ summaryFunction = twoClassSummary,
+ classProbs = TRUE)
>
> set.seed(35)
> glm.tune.1 <- train(y ~ bool_3,
+ data = train.batch,
+ method = "glm",
+ metric = "ROC",
+ trControl = cv.ctrl)
Error in evalSummaryFunction(y, trControl, classLevels, metric, method) :
train()'s use of ROC codes requires class probabilities. See the classProbs option of trainControl()
In addition: Warning message:
In train.default(x, y, weights = w, ...) :
cannnot compute class probabilities for regression
> str(train.batch)
'data.frame': 128046 obs. of 42 variables:
$ offer : int 1194044 1194044 1194044 1194044 1194044 1194044 1194044 1194044 1194044 1194044 ...
$ avgPrice : num 2.68 2.68 2.68 2.68 2.68 ...
...
$ bool_3 : int 0 0 0 0 0 0 0 1 0 0 ...
$ y : num 0 1 0 0 0 1 1 1 1 0 ...
由于 cv.ctrl 将 classProbs 设置为 TRUE,我不明白为什么会出现此错误消息。
有人可以建议吗?
【问题讨论】: