Currently, ranger gives an error if passed with trainControl(method = "none"). You can see the error here:
rm( list = ls())
n <- 1e3
x <- cbind(x = rnorm(n))
y <- c(x + rnorm(n))
train(x, y, method = "ranger", trControl = trainControl(method = "none"))
# Error: Only one model should be specified in tuneGrid with no resampling
This was happening because the minimal grid it was creating has length 2, as it was passing both srule and "extratrees" to expand.grid regardless of the argument len.
The proposed change makes sure expand.grid will have length 1, if len = 1.
(and this does not affect the behavior of anything else whenever len > 1)
Currently, ranger gives an error if passed with
trainControl(method = "none")
. You can see the error here:This was happening because the minimal grid it was creating has length 2, as it was passing both
srule
and "extratrees" to expand.grid regardless of the argumentlen
.The proposed change makes sure expand.grid will have length 1, if
len = 1
.(and this does not affect the behavior of anything else whenever len > 1)