I'm trying to run my Shiny App locally in RStudio but I always get this error message:
> shinyApp(ui, server)
Listening on http://127.0.0.1:5603
Error: sample_fraction too small, no observations sampled. Ranger will EXIT now.
Warning: Error in predict.ranger.forest: User interrupt or internal error.
The dataset I used for the model is not small (17k observations). I'm using Ranger engine for Random Forest and have followed Ranger's documentation by explicity adding sample.fraction's default of 1 for sampling with replacement and 0.632 for sampling without replacement but none of these 2 pairs of settings works. Higher value than 1 also results to error when tuning.
I'm not sure though whether I'm making these settings in the right place of my code below:
## Step 3: Fit (Choosing Algorithms) ====
RF <-
rand_forest() %>%
set_args(trees = tune(),
mtry = tune(),
min_n = tune()
) %>%
set_engine("ranger",
importance = "permutation",
replace = TRUE,
sample.fraction = 1) %>%
set_mode("regression")
I've also tried using sample_fraction instead of sample.fraction but I still got the same error.
I would appreciate any guidance on where I might look next.
I finally found the issue by breaking down the Shiny codes from bare bones structure and rebuilt them piece by piece. The chunk that reproduced the error was input$kpi_ball_control which had a missing "l".