predict {MOFA2} | R Documentation

## Do predictions using a fitted MOFA

### Description

This function uses the latent factors and the weights to do data predictions.

### Usage

    predict(
      object,
      views = "all",
      groups = "all",
      factors = "all",
      add_intercept = TRUE
    )

### Arguments

`object` | a `MOFA` object.
`views` | character vector with the view name(s), or numeric vector with the view index(es). Default is "all".
`groups` | character vector with the group name(s), or numeric vector with the group index(es). Default is "all".
`factors` | character vector with the factor name(s) or numeric vector with the factor index(es). Default is "all".
`add_intercept` | add feature intercepts to the prediction (default is TRUE).

### Details

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 a denoised representation of the data, simply using the equation `Y = WX`. For more mathematical details read the supplementary methods of the manuscript.

### Value

Returns a list with the data reconstructed by the model predictions.

### Examples

    # Using an existing trained model on simulated data
    file <- system.file("extdata", "model.hdf5", package = "MOFA2")
    model <- load_model(file)

    # Predict observations for all data modalities
    predictions <- predict(model)

[Package MOFA2 version 1.2.2 Index]