plot.pre
creates one or more plots depicting the rules in the final
ensemble as simple decision trees.
# S3 method for 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), ...)
an object of class pre
.
character or numeric. Value of the penalty parameter
\(\lambda\) to be employed for selecting the final ensemble. The default
"lambda.min"
employs the \(\lambda\) value within 1 standard
error of the minimum cross-validated error. Alternatively,
"lambda.min"
may be specified, to employ the \(\lambda\) 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)
.
logical. Should linear terms be included in the plot?
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.
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.
logical. Should user be prompted before starting a new page of plots?
character string. Label to be printed in nodes to which the rule does not apply (``exit nodes'')?
logical. Should printed importances be standardized? See
importance
.
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
.
# 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