- object
object of class pre
.
- newdata
optional dataframe of new (test) observations, including all
predictor variables used for deriving the prediction rule ensemble.
- penalty.par.val
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)
.
- response
numeric or character vector of length one. Specifies the
name or number of the response variable (for multivariate responses) or
the name or number of the factor level (for multinomial responses) for
which explanations and contributions should be computed and/or plotted.
Only used forpre
s fitted to multivariate or multinomial responses.
- plot
logical. Should explanations be plotted?
- intercept
logical. Specifies whether intercept should be included in
explaining predictions.
- center.linear
logical. Specifies whether linear terms should be
centered with respect to the training sample mean before computing their
contribution to the predicted value. If intercept = TRUE
, this
will also affect the intercept. That is, the value of the intercept returned
will differ from that of the value returned by the print
method.
- plot.max.nobs
numeric. Specifies maximum number of observations
for which explanations will be plotted. The default (4
) plots the
explanation for the first four observations supplied in newdata
.
- plot.dim
numeric vector of length 2. Specifies the number of rows and
columns in the resulting plot.
- plot.obs.names
logical vector of length 1, NULL, or character vector
of length nrow(data)
supplying the names that should be used for
individual observations' plots. If TRUE
(default),
rownames(newdata)
will be used as titles. If NULL
,
paste("Observation", 1:nrow(newdata))
will be used as titles. If
FALSE
, no titles will be plotted.
- pred.type
character. Specifies the type of predicted values to be
computed, returned and provided in the plot(s). Note that the computed
contributions must be additive and are therefore always on the scale of
the linear predictor.
- digits
integer. Specifies the number of digits used in depcting the
predicted values in the plot.
- cex
numeric. Specifies the relative text size of title, tick and axis
labels.
- ylab
character. Specifies the label for the horizonantal (y-) axis.
- bar.col
character vector of length two. Specifies the colors to be used for
plotting the positive and negative contributions to the predictions, respectively.
- rule.col
character. Specifies the color to be used for plotting the rule
descriptions. If NULL
, rule descriptions are not plotted.
- ...
Further arguments to be passed to predict.pre
and
predict.cv.glmnet
.