Hi! I want to tune a model while forcing a variable in the model using always.split.variables.
It would also be nice to be able to specify bounds for the tuned parameters. Probably specifying upper bound for mtry at number of variables minus one would fix the problem.
library(ranger)
library(tuneRanger)
data("iris")
measure <- list(multiclass.brier)
task <- makeClassifTask(data = iris,
target = "Species")
parameters <- list(respect.unordered.factors = "order",
replace = TRUE,
always.split.variables = c("Sepal.Length"),
importance = "none")
res <- tuneRanger(task, measure = measure,
num.trees = 100,
show.info = TRUE,
tune.parameters = c("mtry", "min.node.size"),
parameters = parameters,
build.final.model = FALSE)
Computing y column(s) for design. Not provided.
Error: Number of variables to be always considered for splitting plus mtry cannot be larger than number of independent variables. Ranger will EXIT now.
Error in ranger::ranger(formula = NULL, dependent.variable.name = tn, :
User interrupt or internal error.
Hi! I want to tune a model while forcing a variable in the model using always.split.variables.
It would also be nice to be able to specify bounds for the tuned parameters. Probably specifying upper bound for mtry at number of variables minus one would fix the problem.
Thanks!