Learn R Programming

SDModels (version 2.0.2)

plot.SDTree: Plot SDTree

Description

Plot the SDTree.

Usage

# S3 method for SDTree
plot(x, main = "", digits = 2, digits_decisions = 2, weighted = TRUE, ...)

Value

A ggplot object

Arguments

x

Fitted object of class SDTree.

main

title for the tree

digits

integer indicating the number of decimal places to round() the leaf values to

digits_decisions

integer indicating the number of decimal places to round() the splitting rule to.

weighted

if true, connections from parent to children is scaled with res_dloss, more important splits result in thicker lines.

...

Further arguments passed to or from other methods.

Author

Markus Ulmer

See Also

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