LDARep: LDA Replications

View source: R/LDARep.R

LDARepR Documentation

LDA Replications

Description

Performs multiple runs of Latent Dirichlet Allocation.

Usage

LDARep(docs, vocab, n = 100, seeds, id = "LDARep", pm.backend, ncpus, ...)

Arguments

docs

[list]
Documents as received from LDAprep.

vocab

[character]
Vocabularies passed to lda.collapsed.gibbs.sampler. For additional (and necessary) arguments passed, see ellipsis (three-dot argument).

n

[integer(1)]
Number of Replications.

seeds

[integer(n)]
Random Seeds for each Replication.

id

[character(1)]
Name for the computation.

pm.backend

[character(1)]
One of "multicore", "socket" or "mpi". If pm.backend is set, parallelStart is called before computation is started and parallelStop is called after.

ncpus

[integer(1)]
Number of (physical) CPUs to use. If pm.backend is passed, default is determined by availableCores.

...

additional arguments passed to lda.collapsed.gibbs.sampler. Arguments will be coerced to a vector of length n. Default parameters are alpha = eta = 1/K and num.iterations = 200. There is no default for K.

Details

The function generates multiple LDA runs with the possibility of using parallelization. The integration is done by the parallelMap-package.

The function returns a LDARep object. You can receive results and all other elements of this object with getter functions (see getJob).

Value

[named list] with entries id for computation's name, jobs for the parameter settings and lda for the results itself.

See Also

Other replication functions: LDAPrototype(), as.LDARep(), getJob(), mergeRepTopics()

Other LDA functions: LDABatch(), LDA(), getTopics()

Other workflow functions: SCLOP(), dendTopics(), getPrototype(), jaccardTopics(), mergeTopics()

Examples

res = LDARep(docs = reuters_docs, vocab = reuters_vocab, n = 4, seeds = 1:4,
   id = "myComputation", K = 7:10, alpha = 1, eta = 0.01, num.iterations = 20)
res
getJob(res)
getID(res)
getLDA(res, 4)


LDARep(docs = reuters_docs, vocab = reuters_vocab,
   K = 10, num.iterations = 100, pm.backend = "socket")



JonasRieger/ldaPrototype documentation built on Feb. 5, 2023, 6:45 p.m.