predict.enpls.fit: Make Predictions from a Fitted Ensemble Partial Least Squares...

Description Usage Arguments Value Author(s) See Also Examples

Description

Make predictions on new data by fitted enpls.fit object.

Usage

1
2
3
## S3 method for class 'enpls.fit'
predict(object, newx, method = c("mean", "median"),
  ...)

Arguments

object

An object of class enpls.fit.

newx

New data to predict with.

method

Use "mean" or "median" to create the final prediction.

...

Additional parameters for predict.

Value

A numeric vector containing the predicted values.

Author(s)

Nan Xiao <https://nanx.me>

See Also

See enpls.fit for fitting ensemble partial least squares regression models.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("alkanes")
x <- alkanes$x
y <- alkanes$y

set.seed(42)
fit <- enpls.fit(x, y, reptimes = 50)
y.pred <- predict(fit, newx = x)
plot(y, y.pred, xlim = range(y), ylim = range(y))
abline(a = 0L, b = 1L)
y.pred.med <- predict(fit, newx = x, method = "median")
plot(y, y.pred.med, xlim = range(y), ylim = range(y))
abline(a = 0L, b = 1L)

enpls documentation built on May 18, 2019, 9:02 a.m.