impute {MOFA} | R Documentation |
This function uses the latent factors and the loadings inferred in order to impute missing values.
impute(object, views = "all", factors = "all", type = c("inRange", "response", "link"))
object |
a |
views |
character vector with the view names, or numeric vector with view indexes. |
factors |
character vector with the factor names, or numeric vector with the factor indexes. |
type |
type of prediction returned, either:
|
Matrix factorization models generate a denoised and condensed low-dimensional representation
of the data which capture the main sources of heterogeneity of the data.
Such representation can be used to do predictions via the equation Y = WZ
.
This method fills the ImputedData
slot by replacing the missing values
in the training data with the model predictions.
For more details see the Methods section of the MOFA article.
a MOFAmodel
object with imputed data in the ImputedData
slot
# Load CLL data filepath <- system.file("extdata", "CLL_model.hdf5", package = "MOFAdata") MOFA_CLL <- loadModel(filepath) # impute missing data in all views using all factors MOFA_CLL <- impute(MOFA_CLL) # Load scMT data filepath <- system.file("extdata", "scMT_model.hdf5", package = "MOFAdata") MOFA_scMT <- loadModel(filepath) # impute missing data in the RNA view using Factor 1 MOFA_scMT <- impute(MOFA_scMT, views="RNA expression", factors="LF1")