mergeTopics: Merge LDA Topic Matrices

View source: R/mergeTopics.R

mergeTopicsR Documentation

Merge LDA Topic Matrices

Description

Generic function, which collects LDA results and merges their topic matrices for a given set of vocabularies.

Usage

mergeTopics(x, vocab, progress = TRUE)

Arguments

x

[named list]
LDARep or LDABatch object.

vocab

[character]
Vocabularies taken into consideration for merging topic matrices.

progress

[logical(1)]
Should a nice progress bar be shown? Turning it off, could lead to significantly faster calculation. Default ist TRUE.

Details

This function uses the function mergeRepTopics or mergeBatchTopics. The topic matrices are transponed and cbinded, so that the resulting matrix contains the counts of vocabularies/words (row wise) in topics (column wise).

Value

[named matrix] with the count of vocabularies (row wise) in topics (column wise).

See Also

Other merge functions: mergeBatchTopics(), mergeRepTopics()

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

Examples

res = LDARep(docs = reuters_docs, vocab = reuters_vocab, n = 4, K = 10, num.iterations = 30)
topics = mergeTopics(res, vocab = reuters_vocab)
dim(topics)
length(reuters_vocab)

## Not run: 
res = LDABatch(docs = reuters_docs, vocab = reuters_vocab, n = 4, K = 10, num.iterations = 30)
topics = mergeTopics(res, vocab = reuters_vocab)
dim(topics)
length(reuters_vocab)

## End(Not run)

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