getTopics {ldaPrototype}R 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

wn(m)Tn(m),ϕkDiscrete(ϕk),w_n^{(m)} \mid T_n^{(m)}, \bm\phi_k \sim \textsf{Discrete}(\bm\phi_k),

ϕkDirichlet(η),\bm\phi_k \sim \textsf{Dirichlet}(\eta),

Tn(m)θmDiscrete(θm),T_n^{(m)} \mid \bm\theta_m \sim \textsf{Discrete}(\bm\theta_m),

θmDirichlet(α)\bm\theta_m \sim \textsf{Dirichlet}(\alpha)

are calculated referring to Griffiths and Steyvers (2004) by

ϕ^k,v=nk(v)+ηnk+Vη,\hat{\phi}_{k, v} = \frac{n_k^{(v)} + \eta}{n_k + V \eta},

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

with VV is the vocabulary size, KK is the number of modeled topics; nk(v)n_k^{(v)} is the count of assignments of the vv-th word to the kk-th topic. Analogously, nk(m)n_k^{(m)} is the count of assignments of the mm-th text to the kk-th topic. N(m)N^{(m)} is the total number of assigned tokens in text mm and nkn_k the total number of assigned tokens to topic kk.

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()


[Package ldaPrototype version 0.3.1 Index]