predict.epx {EPX} | R Documentation |
Predict with an "epx
" object
Description
Predicted values based on an "epx
" object; may specify
different base classifier arguments than those used for phalanx-formation.
Usage
## S3 method for class 'epx'
predict(object, newdata, classifier.args = list(), ...)
Arguments
object |
Object of class " |
newdata |
An optional data frame specifiying variables with which to
predict; if omitted and |
classifier.args |
Additional arguments for the base classifier; same
base classifier as that used for phalanx-formation (specified in
|
... |
Further arguments passed to or from other methods. |
Value
Numeric vector of predicted values (double).
Examples
# Example with data(harvest)
## Phalanx-formation using a base classifier with 50 trees (default = 500)
set.seed(761)
model <- epx(x = harvest[, -4], y = harvest[, 4],
classifier.args = list(ntree = 50))
## Predict training values without additional classifier.args and newdata
## returns the object's ENSEMBLED.FITS
all.equal(predict(model), model$ENSEMBLED.FITS)
## Predict training values using 100 trees (default = 500)
set.seed(761)
preds100 <- predict(model, classifier.args = list(ntree = 100))
## Predict test values by passing dataframe of test predictors to newdata as
## with the predict(model, newdata = . ) function etc.
[Package EPX version 1.0.4 Index]