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]: 0%| | 0/2000 [00:00:00<?, ?it/s] training [regression]: 0%| | 0/2000 [00:00:00<?, ?it/s] training [regression]: 7%| | 148/2000 [00:00:00<00:00:01, 1397.10it/s] training [regression]: 15%| | 294/2000 [00:00:00<00:00:01, 1420.75it/s] training [regression]: 22%|██ | 442/2000 [00:00:00<00:00:01, 1435.66it/s] training [regression]: 29%|███ | 588/2000 [00:00:00<00:00:00, 1438.10it/s] training [regression]: 37%|████ | 736/2000 [00:00:00<00:00:00, 1443.67it/s] training [regression]: 44%|████ | 882/2000 [00:00:00<00:00:00, 1443.98it/s] training [regression]: 51%|█████ | 1028/2000 [00:00:00<00:00:00, 1444.21it/s] training [regression]: 59%|██████ | 1174/2000 [00:00:00<00:00:00, 1444.48it/s] training [regression]: 66%|███████ | 1324/2000 [00:00:00<00:00:00, 1449.08it/s] training [regression]: 73%|███████ | 1470/2000 [00:00:01<00:00:00, 1448.81it/s] training [regression]: 81%|████████ | 1616/2000 [00:00:01<00:00:00, 1448.60it/s] training [regression]: 88%|█████████ | 1762/2000 [00:00:01<00:00:00, 1448.42it/s] training [regression]: 95%|██████████| 1908/2000 [00:00:01<00:00:00, 1448.27it/s] training [regression]: 100%|██████████| 2000/2000 [00:00:01<00:00:00, 1442.41it/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) # }