Rf model inputs
(outcome <- "age")
(vars <- c("shucked_wt", "length", "diameter", "viscera_wt", "shell_wt"))
(fmla <- paste(outcome, "~", paste(vars, collapse = " + ")))
#Abalone model rf
(abalone_model_rf <- ranger(fmla, data = abalone, num.trees = 500, respect.unordered.factors = "order", seed = set.seed))
Gus
October 26, 2022, 2:26pm
2
I think you missed one step. Your fmla
variable is a string actually.
Try fmla <- as.formula(fmla)
FJCC
October 26, 2022, 2:27pm
3
I know nothing about the ranger() function but I notice that the call ends with seed = set.seed
. Since there is a function named set.seed, I suggest you try seed = set.seed()
abalone_model_rf <- ranger(fmla, data = abalone, num.trees = 500,
respect.unordered.factors = "order", seed = set.seed())
Awesome. Thank you! The fmla tip worked.
system
Closed
November 17, 2022, 9:46am
5
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.