keyATM | R Documentation |
Fit keyATM models.
keyATM(
docs,
model,
no_keyword_topics,
keywords = list(),
model_settings = list(),
priors = list(),
options = list(),
keep = c()
)
docs |
texts read via |
model |
keyATM model: |
no_keyword_topics |
the number of regular topics. |
keywords |
a list of keywords. |
model_settings |
a list of model specific settings (details are in the online documentation). |
priors |
a list of priors of parameters. |
options |
a list of options
|
keep |
a vector of the names of elements you want to keep in output. |
A keyATM_output
object containing:
number of keyword topics
number of no-keyword topics
number of terms (number of unique words)
number of documents
the name of the model
topic proportions for each document (document-topic distribution)
topic specific word generation probabilities (topic-word distribution)
number of tokens assigned to each topic
number of times each word type appears
length of each document in tokens
words in the vocabulary (a vector of unique words)
priors
options
specified keywords
perplexity and log-likelihood
estimated \pi
(the probability of using keyword topic word distribution) for the last iteration
values stored during iterations
outputs you specified to store in keep
option
information about the fitting
save.keyATM_output()
, https://keyatm.github.io/keyATM/articles/pkgdown_files/Options.html
## Not run:
library(keyATM)
library(quanteda)
data(keyATM_data_bills)
bills_keywords <- keyATM_data_bills$keywords
bills_dfm <- keyATM_data_bills$doc_dfm # quanteda dfm object
keyATM_docs <- keyATM_read(bills_dfm)
# keyATM Base
out <- keyATM(docs = keyATM_docs, model = "base",
no_keyword_topics = 5, keywords = bills_keywords)
# Visit our website for full examples: https://keyatm.github.io/keyATM/
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.