View source: R/predict.enpls.R
predict.enpls.fit | R Documentation |
Make predictions on new data by fitted enpls.fit object.
## S3 method for class 'enpls.fit'
predict(object, newx, method = c("mean", "median"), ...)
object |
An object of class |
newx |
New data to predict with. |
method |
Use |
... |
Additional parameters for |
A numeric vector containing the predicted values.
Nan Xiao <https://nanx.me>
See enpls.fit
for fitting ensemble
partial least squares regression models.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.