Description Usage Arguments Value
Calculates perplexity for beta on an LDA topic model using the topicmodels package, split into training and testing sets using k-folds
1 | fit.beta.perplexity(dtm, folds, beta.values, k, alpha, control.test)
|
dtm |
Document-term matrix. Constructed using the DocumentTermMatrix() command from the tm package |
folds |
Integer. The number of folds to make training and testing sets; recommended values are '5' and '10' - note that higher values considerably increase the time that model fitting takes |
beta.values |
Numeric vector. The values to test beta for. A good starting point is c(0.001, 0.01, 0.1, 1) |
k |
Integer. Optional parameter: the value of k used in the LDA model. By default k is set to 10 |
alpha |
Numeric. Optional parameter: the value of alpha used in the LDA model. By default alpha is set to 0.1 |
control.test |
List. Optional parameter: the LDA control list used in the LDA model. It is strongly recommended not to use this parameter unless you have good reason. Default settings are: nstart = 5, best = T, burnin = 1000, iter = 2000, thin = 500 |
Dataframe of perplexity for beta.values, calculated for the number of stipulated folds
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.