compareModels: Compare different instances of trained 'MOFAmodel'

Description Usage Arguments Value Examples

View source: R/compareModels.R

Description

Different objects of MOFAmodel are compared in terms of the final value of the ELBO statistics. For model selection the model with the highest ELBO value is selected. The height of the bar indicates the number of inferred factors and the color of the bar the value of the ELBO statistic.

Usage

1
compareModels(models, show_modelnames = FALSE)

Arguments

models

a list containing MOFAmodel objects.

show_modelnames

boolean, whether to indicate the name of each model instance (names of the list in models) or not

Value

a ggplot showing the number of factors and the ELBO statistics of the given models as a barplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
### Example on simulated data
# 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()))
compareModels(MOFAlist)

MOFA documentation built on Feb. 11, 2021, 2:01 a.m.