getTopics: Getter for LDA

View source: R/getTopics.R

getTopicsR Documentation

Getter for LDA

Description

Returns the corresponding element of a LDA object. getEstimators computes the estimators for phi and theta.

Usage

getTopics(x)

getAssignments(x)

getDocument_sums(x)

getDocument_expects(x)

getLog.likelihoods(x)

getParam(x)

getK(x)

getAlpha(x)

getEta(x)

getNum.iterations(x)

getEstimators(x)

Arguments

x

[named list]
LDA object.

Details

The estimators for phi and theta in

w_n^{(m)} \mid T_n^{(m)}, \bmφ_k \sim \textsf{Discrete}(\bmφ_k),

\bmφ_k \sim \textsf{Dirichlet}(η),

T_n^{(m)} \mid \bmθ_m \sim \textsf{Discrete}(\bmθ_m),

\bmθ_m \sim \textsf{Dirichlet}(α)

are calculated referring to Griffiths and Steyvers (2004) by

\hat{φ}_{k, v} = \frac{n_k^{(v)} + η}{n_k + V η},

\hat{θ}_{m, k} = \frac{n_k^{(m)} + α}{N^{(m)} + K α}

with V is the vocabulary size, K is the number of modeled topics; n_k^{(v)} is the count of assignments of the v-th word to the k-th topic. Analogously, n_k^{(m)} is the count of assignments of the m-th text to the k-th topic. N^{(m)} is the total number of assigned tokens in text m and n_k the total number of assigned tokens to topic k.

References

Griffiths, Thomas L. and Mark Steyvers (2004). "Finding scientific topics". In: Proceedings of the National Academy of Sciences 101 (suppl 1), pp.5228–5235, doi: 10.1073/pnas.0307752101.

See Also

Other getter functions: getJob(), getSCLOP(), getSimilarity()

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


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