trainSlalom {slalom} | R Documentation

## Train a SlalomModel object

### Description

Train a SlalomModel to infer model parameters.

### Usage

    trainSlalom(object, nIterations = 5000, minIterations = 700,
      tolerance = 1e-08, forceIterations = FALSE, shuffle = TRUE,
      pretrain = TRUE, verbose = TRUE, seed = NULL, drop_factors = TRUE)

### Arguments

`object` | a `Rcpp_SlalomModel` object
`nIterations` | integer(1) maximum number of iterations to use in training the model (default: 5000)
`minIterations` | integer(1) minimum number of iterations to perform.
`tolerance` | numeric(1) tolerance to allow between iterations (default 1e-08)
`forceIterations` | logical(1) should the model be forced to update `nIteration` times?
`shuffle` | logical(1) should the order in which factors are updated be shuffled between iterations? Shuffling generally helps speed up convergence so is recommended and defaults is `TRUE`
`pretrain` | logical(1), should the model be "pre-trained" to achieve faster convergence and obtain an initial update order? Recommended; default is `TRUE`
`verbose` | logical(1), should messages be printed about what the function is doing? Default is `TRUE`.
`seed` | integer(1) value supplying a random seed to make results reproducible (default is `NULL`)
`drop_factors` | logical(1), should factors be dropped from the model if the model determines them not to be relevant? Default is `TRUE`.

### Details

Train the model using variational Bayes methods to infer parameters.

### Value

an 'Rcpp_SlalomModel' object

### Author(s)

Davis McCarthy

### Examples

    gmtfile <- system.file("extdata", "reactome_subset.gmt", package = "slalom")
    genesets <- GSEABase::getGmt(gmtfile)
    data("mesc")
    model <- newSlalomModel(mesc, genesets, n_hidden = 5, min_genes = 10)
    model <- initSlalom(model)
    model <- trainSlalom(model, nIterations = 10)

[Package slalom version 1.2.0 Index]