grf package options can be set using R's options command. The current available options are:

  • `grf.verbose`: controls whether information is printed during training. The default value is `FALSE`.

  • `grf.legacy.seed`: controls whether grf's random seed behavior depends on the number of CPU threads used to train the forest. The default value is `FALSE`. Set to `TRUE` to recover results produced with grf versions prior to 2.4.0.

grf_options()

Value

Prints the current grf package options.

Examples

# \donttest{ # Enable progress output during training. options(grf.verbose = TRUE) n <- 1500 p <- 10 X <- matrix(rnorm(n * p), n, p) Y <- X[, 1] * rnorm(n) r.forest <- regression_forest(X, Y)
#> training [regression]: 0%| | 0/2000 [00:00:00<?, ?it/s] training [regression]: 0%| | 0/2000 [00:00:00<?, ?it/s] training [regression]: 0%| | 0/2000 [00:00:00<?, ?it/s] training [regression]: 7%| | 146/2000 [00:00:00<00:00:01, 1386.44it/s] training [regression]: 15%| | 294/2000 [00:00:00<00:00:01, 1425.49it/s] training [regression]: 22%|██ | 438/2000 [00:00:00<00:00:01, 1427.97it/s] training [regression]: 29%|███ | 582/2000 [00:00:00<00:00:00, 1429.78it/s] training [regression]: 36%|████ | 730/2000 [00:00:00<00:00:00, 1436.87it/s] training [regression]: 44%|████ | 874/2000 [00:00:00<00:00:00, 1435.64it/s] training [regression]: 51%|█████ | 1024/2000 [00:00:00<00:00:00, 1442.81it/s] training [regression]: 58%|██████ | 1170/2000 [00:00:00<00:00:00, 1443.35it/s] training [regression]: 66%|███████ | 1314/2000 [00:00:00<00:00:00, 1441.79it/s] training [regression]: 73%|███████ | 1464/2000 [00:00:01<00:00:00, 1446.31it/s] training [regression]: 80%|████████ | 1610/2000 [00:00:01<00:00:00, 1447.27it/s] training [regression]: 88%|█████████ | 1756/2000 [00:00:01<00:00:00, 1447.52it/s] training [regression]: 95%|█████████ | 1900/2000 [00:00:01<00:00:00, 1446.26it/s] training [regression]: 100%|██████████| 2000/2000 [00:00:01<00:00:00, 1439.71it/s]
options(grf.verbose = FALSE) # Print current package options. grf_options()
#> grf.verbose grf.legacy.seed #> FALSE FALSE
# Use random seed behavior prior to version 2.4.0. options(grf.legacy.seed = TRUE) # Use random seed independent of num.threads (default as of version 2.4.0 and higher). options(grf.legacy.seed = FALSE) # }