Description Usage Arguments Value Author(s) Examples
View source: R/predict-msaenet.R
Make predictions on new data by a msaenet model object.
1 2 |
object |
An object of class |
newx |
New data to predict with. |
... |
Additional parameters, particularly prediction |
Numeric matrix of the predicted values.
Nan Xiao <https://nanx.me>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | dat <- msaenet.sim.gaussian(
n = 150, p = 500, rho = 0.6,
coef = rep(1, 5), snr = 2, p.train = 0.7,
seed = 1001
)
msaenet.fit <- msaenet(
dat$x.tr, dat$y.tr,
alphas = seq(0.2, 0.8, 0.2),
nsteps = 3L, seed = 1003
)
msaenet.pred <- predict(msaenet.fit, dat$x.te)
msaenet.rmse(dat$y.te, msaenet.pred)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.