I am trying to load a pretrained rds file into my shiny app. but facing an error while using the predict function. Tried the same for readRDS and load but still facing the same error.
Loading the rda file
filedata3 <- eventReactive(input$Cal, {
if(is.null(filedata3)) return (NULL)
infile <- input$Marefa
get(load(file = infile$datapath))
})
My predict statements:
new <- data.frame(DBNR = Production,Inventory_Coverage = Inventory,
RCCP..M.3. = Capacity,MOQ_Coverage = MOQ.cov,Demand_Variability=Demand)
Marefafit<-predict(Marefa,new,type='raw')
error message:
Listening on http://127.0.0.1:4380
Warning: Error in : unused arguments (method = "ranger", modelInfo = list("Random Forest", c("e1071", "ranger", "dplyr"), function (pkg)
{
requireNamespace("ranger")
current <- packageDescription("ranger")$Version
expected <- "0.8.0"
if (compareVersion(current, expected) < 0) stop("This modeling workflow requires ranger version ", expected, "or greater.", call. = FALSE)
}, NULL, c("Classification", "Regression"), list(c(2, 3, 1), c(2, 1, 2), c(1, 3, 2)), function (x, y, len = NULL, search = "grid")
{
if (search == "grid") {
srule <- if (is.factor(y)) "gini" else "variance"
out <- expand.grid(mtry = caret::var_seq(p = ncol(x), classification = is.factor(y), len = len), min.node.size = ifelse(is.factor(y), 1, 5), splitrule = c(srule, "extratrees"))
} else {
srules <- if (is.factor(y)) c("gini", "extratrees") else c("variance", "extratrees", "maxstat")
out <- data.frame(min.node.size = sample(1:(min(20, nrow(x))), size = len, rep [... truncated]
[No stack trace available]