View source: R/topic_modeling_core.R
Cluster2TopicModel | R Documentation |
Represents a document clustering as a topic model of two matrices. phi: P(term | cluster) theta: P(cluster | document)
Cluster2TopicModel(dtm, clustering, ...)
dtm |
A document term matrix of class |
clustering |
A vector of length |
... |
Other arguments to be passed to |
Returns a list with two elements, phi and theta. 'phi' is a matrix whose j-th row represents P(terms | cluster_j). 'theta' is a matrix whose j-th row represents P(clusters | document_j). Each row of theta should only have one non-zero element.
## Not run:
# Load pre-formatted data for use
data(nih_sample_dtm)
data(nih_sample)
result <- Cluster2TopicModel(dtm = nih_sample_dtm,
clustering = nih_sample$IC_NAME)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.