Learn R Programming

pre (version 0.3.0)

plot.pre: Plot method for class pre

Description

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

Usage

# S3 method for pre
plot(x, penalty.par.val = "lambda.1se", linear.terms = TRUE,
  nterms = NULL, ask = FALSE, exit.label = "0", standardize = FALSE,
  plot.dim = c(3, 3), ...)

Arguments

x

an object of class pre.

penalty.par.val

character. Which value of the penalty parameter criterion should be used? The value yielding minimum cv error ("lambda.min") or penalty parameter yielding error within 1 standard error of minimum cv error ("lambda.1se")? Alternatively, a numeric value may be specified, corresponding to one of the values of lambda in the sequence used by glmnet, for which estimated cv error can be inspected by running x$glmnet.fit and plot(x$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.

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 plot. If nterms > plot.dim[1] * plot.dim[2], multiple plotting pages will be created.

...

Arguments to be passed to gpar.

See Also

pre, print.pre

Examples

Run this code
# NOT RUN {
 set.seed(42)
 airq.ens <- pre(Ozone ~ ., data = airquality[complete.cases(airquality),])
 plot(airq.ens)
# }

Run the code above in your browser using DataLab