perplexity | R Documentation |
Determine the perplexity of a fitted model.
perplexity(object, newdata, ...)
## S4 method for signature 'VEM,simple_triplet_matrix'
perplexity(object, newdata, control, ...)
## S4 method for signature 'Gibbs,simple_triplet_matrix'
perplexity(object, newdata, control, use_theta = TRUE,
estimate_theta = TRUE, ...)
## S4 method for signature 'Gibbs_list,simple_triplet_matrix'
perplexity(object, newdata, control, use_theta = TRUE,
estimate_theta = TRUE, ...)
object |
Object of class |
newdata |
If missing, the perplexity for the data to which the
model was fitted is determined. For objects fitted using Gibbs sampling
|
control |
If missing, the |
use_theta |
Object of class |
estimate_theta |
Object of class |
... |
Further arguments passed to the different methods. |
The specified control is modified to ensure that (1)
estimate.beta=FALSE
and (2) nstart=1
.
For "Gibbs_list"
objects the control
is further modified
to have (1) iter=thin
and (2) best=TRUE
and the model is
fitted to the new data with this control for each available
iteration. The perplexity is then determined by averaging over the
same number of iterations.
If a list
is supplied as object
, it is assumed that it
consists of several models which were fitted using different starting
configurations.
A numeric value.
Bettina Gruen
Blei D.M., Ng A.Y., Jordan M.I. (2003). Latent Dirichlet Allocation. Journal of Machine Learning Research, 3, 993–1022.
Griffiths T.L., Steyvers, M. (2004). Finding Scientific Topics. Proceedings of the National Academy of Sciences of the United States of America, 101, Suppl. 1, 5228–5235.
Newman D., Asuncion A., Smyth P., Welling M. (2009). Distributed Algorithms for Topic Models. Journal of Machine Learning Research, 10, 1801–1828.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.