fit_lda {Twitmo} | R Documentation |
Fit LDA Topic Model
Description
Estimate a LDA topic model using VEM or Gibbs Sampling.
Usage
fit_lda(pooled_dfm, n_topics, ...)
Arguments
pooled_dfm |
Object of class dfm (see dfm) containing (pooled) tweets. |
n_topics |
Integer with number of topics. |
... |
Additional arguments passed to LDA. |
Value
Object of class LDA.
Examples
## Not run:
library(Twitmo)
# load tweets (included in package)
mytweets <- load_tweets(system.file("extdata", "tweets_20191027-141233.json", package = "Twitmo"))
# Pool tweets into longer pseudo-documents
pool <- pool_tweets(data = mytweets)
pooled_dfm <- pool$document_term_matrix
# fit your LDA model with 7 topics
model <- fit_lda(pooled_dfm, n_topics = 7, method = "Gibbs")
## End(Not run)
[Package Twitmo version 0.1.2 Index]