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, ask = FALSE, exit.label = "0", standardize = FALSE,
plot.dim = c(3, 3), ...)
an object of class pre
.
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)
.
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.
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 plot. If
nterms > plot.dim[1] * plot.dim[2]
, multiple plotting pages will be
created.
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