impute | R Documentation |
This function uses the latent factors and the loadings to impute missing values.
impute(
object,
views = "all",
groups = "all",
factors = "all",
add_intercept = TRUE
)
object |
a |
views |
character vector with the view name(s), or numeric vector with view index(es). |
groups |
character vector with the group name(s), or numeric vector with group index(es). |
factors |
character vector with the factor names, or numeric vector with the factor index(es).
|
add_intercept |
add feature intercepts to the imputation (default is TRUE). |
MOFA generates a denoised and condensed low-dimensional representation of the data that captures the main sources of heterogeneity of the data.
This representation can be used to reconstruct the data, simply using the equation Y = WX
.
For more details read the supplementary methods of the manuscript.
Note that with impute
you can only generate the point estimates (the means of the posterior distributions).
If you want to add uncertainity estimates (the variance) you need to set impute=TRUE
in the training options.
See get_default_training_options
.
This method fills the imputed_data
slot by replacing the missing values in the input data with the model predictions.
# Using an existing trained model on simulated data
file <- system.file("extdata", "model.hdf5", package = "MOFA2")
model <- load_model(file)
# Impute missing values in all data modalities
imputed_data <- impute(model, views = "all")
# Impute missing values in all data modalities using factors 1:3
imputed_data <- impute(model, views = "all", factors = 1:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.