package_LDA_set | R Documentation |
Name the elements (LDA models) and set the class
(LDA_set
) of the models returned by LDA_set
.
package_LDA_set(mods, mod_topics, mod_seeds)
mods |
Fitted models returned from |
mod_topics |
Vector of |
mod_seeds |
Vector of |
lis
(class: LDA_set
) of LDA models (class:
LDA_VEM
).
data(rodents)
document_term_table <- rodents$document_term_table
topics <- 2
nseeds <- 2
control <- LDA_set_control()
mod_topics <- rep(topics, each = length(seq(2, nseeds * 2, 2)))
iseed <- control$iseed
mod_seeds <- rep(seq(iseed, iseed + (nseeds - 1)* 2, 2), length(topics))
nmods <- length(mod_topics)
mods <- vector("list", length = nmods)
for (i in 1:nmods){
LDA_msg(mod_topics[i], mod_seeds[i], control)
control_i <- prep_LDA_control(seed = mod_seeds[i], control = control)
mods[[i]] <- topicmodels::LDA(document_term_table, k = mod_topics[i],
control = control_i)
}
package_LDA_set(mods, mod_topics, mod_seeds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.