Skip to contents

Fit a ranger Random Forest model to a cv_set

Usage

fit_ranger(
  cv_set,
  y_var,
  id_vars,
  pred_vars,
  hyper_control = list(mtry = NULL, min.node.size = NULL, num.trees = 500),
  importance = "none",
  quantile_levels = c(0.01, 0.025, seq(0.05, 0.95, by = 0.05), 0.975, 0.99),
  return_model = FALSE
)

Arguments

cv_set

list object containing analysis and assessment data.frames

y_var

string name of column of observed values

id_vars

names of columns used as keys/ids in data.frames

pred_vars

vector string of predictor variables to use in model

hyper_control

hyperparameters to use in the model, in either list or named vector format. Defaults are ranger defaults

importance

the method with which to estimate variable importance. Default = 'none' means no variable importance is estimated

quantile_levels

quantile levels to use when predicted via quantile regression. Default = c(0.01,0.025, seq(0.05,0.95, by = 0.05), 0.975, 0.99)

return_model

whether or not to return ranger model object. Default = FALSE.

Value

prediction intervals on analysis and assessment data or list containing model object and prediction intervals, if return_model = TRUE