Description Usage Arguments Value Examples
Calculates the probabilistic coherence of a topic or topics. This approximates semmantic coherence or human understandability of a topic.
1 | CalcProbCoherence(phi, dtm, M = 5)
|
phi |
A numeric matrix or a numeric vector. The vector, or rows of the matrix represent the numeric relationship between topic(s) and terms. For example, this relationship may be p(word|topic) or p(topic|word). |
dtm |
A document term matrix or co-occurence matrix of class
|
M |
An integer for the number of words to be used in the calculation. Defaults to 5 |
Returns an object of class numeric
corresponding to the
probabilistic coherence of the input topic(s).
1 2 3 4 5 | # Load a pre-formatted dtm and topic model
data(nih_sample_topic_model)
data(nih_sample_dtm)
CalcProbCoherence(phi = nih_sample_topic_model$phi, dtm = nih_sample_dtm, M = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.