Learn R Programming

ldaPrototype (version 0.3.1)

as.LDARep: LDARep Constructor

Description

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

Usage

as.LDARep(...)

# S3 method for default as.LDARep(lda, job, id, ...)

# S3 method for 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?

Value

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

Details

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

See Also

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

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

Examples

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

Run the code above in your browser using DataLab