Description Usage Arguments Details Value See Also
View source: R/lda_miretrieve.R
Plot perplexity score of various LDA models.
1 2 3 4 5 6 7 8 9 10 11 | plot_perplexity(
df,
start = 2,
end = 5,
stopwords = stopwords_miretrieve,
method = "gibbs",
control = NULL,
col.abstract = Abstract,
col.pmid = PMID,
title = NULL
)
|
df |
Data frame containing abstracts and PubMed-IDs. |
start |
Integer. Minimum amount of |
end |
Integer. Maximum amount of |
stopwords |
Data frame containing stop words. |
method |
String. Either |
control |
Control parameters for LDA modeling. For more information,
see the documentation of the |
col.abstract |
Column containing abstracts. |
col.pmid |
Column containing PubMed-ID. |
title |
String. Plot title. |
Plot perplexity score of various LDA models. plot_perplexity()
fits
different LDA models for k
topics in the range
between start
and end
. For each
LDA model, the perplexity score is plotted against the corresponding value of
k
.
Plotting the perplexity score of various LDA models
can help in identifying the optimal number of topics to fit an LDA model for.
plot_perplexity()
is based on LDA()
from the package
topicmodels.
Elbow plot displaying perplexity scores of different LDA models.
Other LDA functions:
assign_topic_lda()
,
fit_lda()
,
plot_lda_term()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.