使用游侠方法插入符号火车功能

Using ranger method caret train function

我在使用带有插入符的游侠来预测概率时遇到了问题。这是我的代码:

model <- train(Species ~ .,
               data = iris,
               method = "ranger",
               probability = TRUE)

这 returns 以下错误、警告和消息。

## 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)

classProbs 放入 trControl 中,如:

model <- train(
  Species  ~ .
  ,data = iris
  ,method = "ranger"
  ,trControl = trainControl(classProbs=TRUE)
)