Learn R Programming

MOFA (version 1.3.1)

selectModel: 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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab