我在使用ranger和插入符号来预测概率时遇到了问题。下面是我的代码:
model <- train(Species ~ .,
data = iris,
method = "ranger",
probability = TRUE)这将返回以下错误、警告和消息。
## Something is wrong; all the Accuracy metric values are missing:
## Accuracy Kappa
## Min. : NA Min. : NA
## 1st Qu.: NA 1st Qu.: NA
## Median : NA Median : NA
## Mean :NaN Mean :NaN
## 3rd Qu.: NA 3rd Qu.: NA
## Max. : NA Max. : NA
## NA's :6 NA's :6
## Error: Stopping
## In addition: There were 50 or more warnings (use warnings() to see the first 50)不过,在插入符号之外运行它是可行的。
ranger(Species ~ ., data = iris, probability = TRUE)发布于 2017-03-01 11:42:10
将classProbs放入trControl中,如下所示:
model <- train(
Species ~ .
,data = iris
,method = "ranger"
,trControl = trainControl(classProbs=TRUE)
)https://stackoverflow.com/questions/42522535
复制相似问题