plot.pre: Plot method for class pre

Description Usage Arguments See Also Examples

View source: R/pre.R

Description

plot.pre creates one or more plots depicting the rules in the final ensemble as simple decision trees.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'pre'
plot(
  x,
  penalty.par.val = "lambda.1se",
  linear.terms = TRUE,
  nterms = NULL,
  fill = "white",
  ask = FALSE,
  exit.label = "0",
  standardize = FALSE,
  plot.dim = c(3, 3),
  ...
)

Arguments

x

an object of class pre.

penalty.par.val

character or numeric. Value of the penalty parameter λ to be employed for selecting the final ensemble. The default "lambda.min" employs the λ value within 1 standard error of the minimum cross-validated error. Alternatively, "lambda.min" may be specified, to employ the λ value with minimum cross-validated error, or a numeric value >0 may be specified, with higher values yielding a sparser ensemble. To evaluate the trade-off between accuracy and sparsity of the final ensemble, inspect pre_object$glmnet.fit and plot(pre_object$glmnet.fit).

linear.terms

logical. Should linear terms be included in the plot?

nterms

numeric. The total number of terms (or rules, if linear.terms = FALSE) being plotted. Default is NULL, resulting in all terms of the final ensemble to be plotted.

fill

character of length 1 or 2. Background color(s) for terminal panels. If one color is specified, all terminal panels will have the specified background color. If two colors are specified (the default, the first color will be used as the background color for rules with a positively valued coefficient; the second color for rules with a negatively valued coefficient.

ask

logical. Should user be prompted before starting a new page of plots?

exit.label

character string. Label to be printed in nodes to which the rule does not apply (“exit nodes”)?

standardize

logical. Should printed importances be standardized? See importance.

plot.dim

integer vector of length two. Specifies the number of rows and columns in the plot. The default yields a plot with three rows and three columns, depicting nine baselearners per plotting page.

...

Arguments to be passed to gpar.

See Also

pre, print.pre

Examples

1
2
3
set.seed(42)
 airq.ens <- pre(Ozone ~ ., data = airquality[complete.cases(airquality),])
 plot(airq.ens)

pre documentation built on March 13, 2020, 2:23 a.m.