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 "eforest".

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:

  • Numeric: numeric or integer vectors;

  • Nominal: factors;

  • Functions: objects of class "fdata";

  • Graphs: (lists of) objects of class "igraph".

Each element (i.e., variable) in the covariates list must have the same length(), which corresponds to the (new) sample size. If newdata is omitted, fitted values of individual trees are somehow combined (see Details) and returned.

...

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.


[Package etree version 0.1.0 Index]