as.LDARep: LDARep Constructor

View source: R/as.LDARep.R

as.LDARepR Documentation

LDARep Constructor

Description

Constructs a LDARep object for given elements lda, job and id.

Usage

as.LDARep(...)

## Default S3 method:
as.LDARep(lda, job, id, ...)

## S3 method for class 'LDARep'
as.LDARep(x, ...)

is.LDARep(obj, verbose = FALSE)

Arguments

...

additional arguments

lda

[named list]
List of LDA objects, named by the corresponding "job.id" (integerish). If list is unnamed, names are set.

job

[data.frame or named vector]
A data.frame or data.table with named columns (at least) "job.id" (integerish), "K", "alpha", "eta" and "num.iterations" or a named vector with entries (at least) "K", "alpha", "eta" and "num.iterations". If not passed, it is interpreted from param of each LDA.

id

[character(1)]
A name for the computation. If not passed, it is set to "LDARep".

x

[named list]
LDABatch or LDARep object.

obj

[R object]
Object to test.

verbose

[logical(1)]
Should test information be given in the console?

Details

Given a list of LDA objects the function returns a LDARep object, which can be handled using the getter functions at getJob.

Value

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

See Also

Other constructor functions: LDA(), as.LDABatch()

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

Examples

res = LDARep(docs = reuters_docs, vocab = reuters_vocab, n = 4, K = 7, num.iterations = 20)
lda = getLDA(res)

res2 = as.LDARep(lda, id = "newName")
res2
getJob(res2)
getJob(res)

## Not run: 
batch = LDABatch(docs = reuters_docs, vocab = reuters_vocab, n = 4, id = "TEMP", K = 30)
res3 = as.LDARep(batch)
res3
getJob(res3)

## End(Not run)


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