View source: R/NormalBlockBase-S3methods.R
| predict.NormalBlockBase | R Documentation |
Predicts the mean of the observations Y for new covariates X,
on the original scale of Y: B' X for the variance-block models (the
latent block signals, centered, average out; unlike fitted(), which adds
their posterior mean for the training observations), C B' X for the
mean-block models. For zero-inflated models, the mean of the Gaussian
component.
## S3 method for class 'NormalBlockBase'
predict(object, new_X, ...)
object |
An object of class NormalBlockBase. |
new_X |
New set of covariates. |
... |
not used, only here for S3 compatibility |
A n*p prediction matrix for new observations
ex_data <- generate_normal_block_var_data(n = 50, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex_data$Y, ex_data$X)
model <- normal_block(data, blocks = 3, control = NB_control(verbose = FALSE))
predict(model, ex_data$X[1:3, , drop = FALSE])[, 1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.