validate_RF: Compute accuracy metrics on test set for RF

View source: R/validation.R

validate_RFR Documentation

Compute accuracy metrics on test set for RF

Description

Compute accuracy metrics on test set for RF

Usage

validate_RF(
  formula,
  data,
  rep = 10,
  Ncpu = 1,
  spatial = FALSE,
  seed = 123,
  method = "CV",
  return_fit = TRUE,
  ...
)

Arguments

formula

a model formula used to fit the data

data

the full dataset

rep

the number of cross validation replicates (default = 10)

Ncpu

the number of CPU cores to be used (default = 1)

spatial

either FALSE (default), or TRUE (to use matrix of distances as predictor)

seed

the seed used to control the reproducibility of the cross validation

method

either "CV" for cross-validation or "OOB" for directly using the out-of-bag observations generated when growing the forest

return_fit

whether to return the fit on all the data as attribute (default = FALSE)

...

additional parameters to be passed to ranger::ranger()

Value

a tibble with the CV/OOB replicates in row and accuracy metrics in columns

See Also

compute_metrics() for details on the function computing the values outputted here

Examples

validate_RF(staff_rangers_log ~ PA_area_log, data = data_test, method = "CV")
validate_RF(staff_rangers_log ~ PA_area_log, data = data_test,
                 rep = 1, num.trees = 10, method = "OOB")



courtiol/rangeRinPA documentation built on Sept. 29, 2022, 9:54 a.m.