Description Usage Arguments Value Examples
Function to calculate topics and words arrays from the mallet model.
1 | topic_table(model)
|
model |
tmTopicModel mallet type model. |
topics Array of the topics.
words Array of the most important words in topic.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
library(rJava)
x <- tmCorpus(lapply(1:100, function(x) paste(sample(LETTERS, 11),
collapse = "")))
model <- train(x)
new_x <- tmCorpus(lapply(1:100, function(x) paste(sample(LETTERS, 11),
collapse = "")))
topic_table(model)
y <- DocumentTermMatrix(x)
rownames(y) <- meta(x, "title")
jss_TM <-
list(VEM = train(y, k = k, control = list(seed = SEED)),
VEM_fixed = train(y, k = k,
control = list(estimate.alpha = FALSE, seed = SEED)),
Gibbs = train(y, k = k, method = "Gibbs",
control = list(seed = SEED, burnin = 1000,
thin = 100, iter = 1000)))
pred_VEM <- predict(jss_TM$VEM, new_x)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.