Description Usage Arguments Value Examples
Make predictions on new data by an OHPL model object.
1 2 3 |
object |
An object of class |
newx |
Predictor matrix of the new data. |
ncomp |
Optimal number of components.
If is |
type |
Prediction type. |
... |
Additional parameters. |
Numeric matrix of the predicted values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # generate simulation data
dat <- OHPL.sim(
n = 100, p = 100, rho = 0.8,
coef = rep(1, 10), snr = 3, p.train = 0.5,
seed = 1010
)
# split training and test set
x <- dat$x.tr
y <- dat$y.tr
x.test <- dat$x.te
y.test <- dat$y.te
# fit the OHPL model
fit <- OHPL(x, y, maxcomp = 3, gamma = 0.5, G = 10, type = "max")
# make predictions
y.pred <- predict(fit, x.test)
y.pred
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.