selectModel {MOFA} | R Documentation

## Select the best model from a list of trained `MOFAmodel` objects

### Description

Different trained objects of `MOFAmodel` are compared in terms of the final value of the ELBO statistics and the model with the highest ELBO value is selected.

### Usage

    selectModel(models, plotit = TRUE)

### Arguments

`models` | a list containing `MOFAmodel` objects.
`plotit` | show a plot of the characteristics of the compared `MOFAmodel` objects (ELBO value and number of inferred factors)?

### Value

a single `MOFAmodel` with the best ELBO statistics from the provided list

### Examples

    # Simulate Data
    data <- makeExampleData()
    # Create MOFA model
    MOFAobject <- createMOFAobject(data)
    # Prepare MOFA model
    MOFAobject <- prepareMOFA(MOFAobject)
    # Train several instances of MOFA models
    n_inits <- 3
    MOFAlist <- lapply(seq_len(n_inits), function(i) runMOFA(MOFAobject, outfile=tempfile()))
    selectModel(MOFAlist)

[Package MOFA version 1.6.2 Index]