Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ctm

Correlated Topic Model


Description

Estimate a CTM model using for example the VEM algorithm.

Usage

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

Arguments

x

Object of class "DocumentTermMatrix" with term-frequency weighting or an object coercible to a "simple_triplet_matrix" with integer entries.

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.

...

Currently not used.

Details

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

Value

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

Author(s)

Bettina Gruen

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

Examples

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

topicmodels

Topic Models

v0.2-12
GPL-2
Authors
Bettina Grün [aut, cre] (<https://orcid.org/0000-0001-7265-4773>), Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>), David M Blei [ctb, cph] (VEM estimation of LDA and CTM), John D Lafferty [ctb, cph] (VEM estimation of CTM), Xuan-Hieu Phan [ctb, cph] (MCMC estimation of LDA), Makoto Matsumoto [ctb, cph] (Mersenne Twister RNG), Takuji Nishimura [ctb, cph] (Mersenne Twister RNG), Shawn Cokus [ctb] (Mersenne Twister RNG)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.