Learn R Programming

topicmodels (version 0.0-6)

CTM: Correlated Topic Model

Description

Estimate a CTM model using the VEM algorithm.

Usage

CTM(x, k, method = "VEM", control = NULL, model = NULL, 
    ...)

Arguments

x
Object of class "DocumentTermMatrix"
k
Integer; number of topics
method
The method to be used for fitting; currently only method = "VEM" is supported.
control
A named list of the control parameters for estimation or an object of class "CTM_VEMcontrol".
model
Object of class "CTM" for initialization.
...
Optional arguments. Currently not used.

Value

  • CTM() returns an object of class "CTM".

Details

The C code for CTM from David M. Blei is used to estimate and fit a correlated topic model.

References

Blei D.M., Lafferty J.D. (2007). A Correlated Topic Model of Science. The Annals of Applied Statistics, 1(1), 17--35.

See Also

"CTM_VEMcontrol"

Examples

Run this code
data("AssociatedPress", package = "topicmodels")
ctm <- CTM(AssociatedPress[1:20,], k = 2)

Run the code above in your browser using DataLab