selectModel: Select the best model from a list of trained 'MOFAmodel'...

Description Usage Arguments Value Examples

View source: R/compareModels.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

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