predict.eforest {etree} | R Documentation |
Predictions for Energy Forests
Description
Compute predictions for objects of class "eforest"
(i.e., as returned
by eforest()
).
Usage
## S3 method for class 'eforest'
predict(object, newdata = NULL, ...)
Arguments
object |
A fitted Energy Forest of class |
newdata |
Optional set of new covariates used to make predictions. Must be provided as a list, where each element is a different variable. Currently available types and the form they need to have to be correctly recognized are the following:
Each element (i.e., variable) in the covariates list must have the same
|
... |
Additional arguments. |
Details
The predict()
method for "eforest"
objects computes predictions
for Energy Forests as returned by eforest()
.
Predictions are based either on the fitted values (if newdata
is
NULL
) or on the new set of covariates (when newdata
is
provided). In both cases, each tree in object$ensemble
is used to make
predictions by calling predict()
on it
(with the same specification of newdata
). Then, individual trees'
predictions for any single observation are combined by majority voting rule
for classification or by arithmetic mean for regression.
Value
Predictions, in the form of a factor for classification or as a numeric vector for regression.