X_RF_autotune_simple: Simple Autotuning for X-Learner with honest RF

Description Usage Arguments See Also Examples

View source: R/Xhrf_autotune_simple.R

Description

This function tunes the X-Learner with honest random forest by testing which of 11 prespecified settings seems to be the best

Usage

1
2
X_RF_autotune_simple(feat, tr, yobs, ntree = 2000, ntree_testing = 600,
  nthread = 0, verbose = TRUE)

Arguments

feat

A data frame of all the features.

tr

A numeric vector contain 0 for control and 1 for treated variables.

yobs

A numeric vector containing the observed outcomes.

ntree

Number of trees used

nthread

Number of threads which can run in parallel. If set 0, then the maximum amount of possible threads is determined automatically. If set to 1 then the algorithm is absolutely deterministic (after specifying a seed).

See Also

X_RF_autotune_gpp, X_RF_autotune_hyperband

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  set.seed(14236142)
  feat <- iris[, -1]
  tr <- rbinom(nrow(iris), 1, .5)
  yobs <- iris[, 1]
  # train a
  xl_gpp <- X_RF_autotune_simple(feat, tr, yobs, ntree = 100, nthread = 0,
  verbose = FALSE, init_points = 5, n_iter = 1)
  # computes the CATE and confidence intervals for CATE
  EstimateCate(xl_gpp, feat)
  CateCI(xl_gpp, feat, B = 5, verbose = FALSE)

soerenkuenzel/hte documentation built on June 12, 2018, 4:26 p.m.