This function visualizes the out-of-bag performance of an SDForest for different complexity parameters. Can be used to choose the optimal complexity parameter.

plotOOB(object, sqrt_scale = FALSE)

Arguments

object

A paths object with loss_path matrix with the out-of-bag performance for each complexity parameter.

sqrt_scale

If TRUE the x-axis is on a square root scale.

Value

A ggplot object

See also

Author

Markus Ulmer

Examples

set.seed(1)
n <- 10
X <- matrix(rnorm(n * 5), nrow = n)
y <- sign(X[, 1]) * 3 + sign(X[, 2]) + rnorm(n)
model <- SDForest(x = X, y = y, Q_type = 'no_deconfounding', cp = 0.5)
paths <- regPath(model)
plotOOB(paths)