predict.gensemble: predict method for generalized ensemble methods.

Description Usage Arguments Details Value Author(s) See Also

Description

Prediction of data using a model built with gensemble

Usage

1
2
## S3 method for class 'gensemble'
predict(object, X, type = c("prob", "class"), method = c("prob", "vote"), return.all = F, ...)

Arguments

object

An instance of gensemble-class.

X

The input predictors.

type

For classification, either probabilities or the class name can be returned.

method

For classification, if method is prob, the assigned class will be the highest probability. If method is vote, the assigned class will be the class with the highest number of votes across all underlying models.

return.all

For regression, if TRUE, a matrix with the output of each underlying model will be returned in addition to a the output vector.

...

Present for compatibility. You could put stuff here but it won't be used.

Details

Please see gensemble for examples.

Value

The return value will vary depending on classification or regression, and if return.all was FALSE (default) or TRUE.

For classification, the return value will be a matrix of probabilities where each row corresponds to the input X and the columns are the classes and the probabilites aggregated from the underlying models.

For regression, the return value will be a vector of the predictor values. If return.all is TRUE, the return value will be a list. The first item is the vector of predicted values, and the second is a matrix where each row corresponds to the input X and each column is the predicted value generated from each model. For example an input X with 150 rows, using a gensemble with 100 underlying models would return a 150 row x 100 column matrix.

Author(s)

Peter Werner and Eugene Dubossarsky gensemble.r@gmail.com

See Also

gensemble, gensemble-class.


gensemble documentation built on May 2, 2019, 1:02 p.m.