plot.tuning_output: Plot causal forest tuning results

Description Usage Arguments Value See Also Examples

View source: R/viz_output.R

Description

If hyperparameter tuning was performed during the causal forest fit, this function will plot the error as a function of one of the tuned parameters.

Usage

1
2
## S3 method for class 'tuning_output'
plot(x, param = NULL, ...)

Arguments

x

The tuning_output object that is part of a trained causal_forest object

param

The parameter to plot on the horizontal axis. Defaults to the first parameter in tuning_output$params

...

Additional arguments (ignored)

Value

A ggplot2 plot object

See Also

Other plotting methods: plot.ate(), plot.cf_eval(), plot.results()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
 require(grf)

 n <- 2000; p <- 10

 X <- matrix(rnorm(n * p), n, p)
 W <- rbinom(n, 1, 0.4 + 0.2 * (X[, 1] > 0))
 Y <- pmax(X[, 1], 0) * W + X[, 2] + pmin(X[, 3], 0) + rnorm(n)
 cf <- causal_forest(X, Y, W, tune.parameters = 'min.node.size')

 plot(cf$tuning_output)

## End(Not run)

ensley-nexant/cfeval documentation built on May 20, 2020, 12:34 a.m.