keyATM {keyATM} | R Documentation |
keyATM main function
Description
Fit keyATM models.
Usage
keyATM(
docs,
model,
no_keyword_topics,
keywords = list(),
model_settings = list(),
priors = list(),
options = list(),
keep = c()
)
Arguments
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. |
Value
A keyATM_output
object containing:
- keyword_k
number of keyword topics
- no_keyword_topics
number of no-keyword topics
- V
number of terms (number of unique words)
- N
number of documents
- model
the name of the model
- theta
topic proportions for each document (document-topic distribution)
- phi
topic specific word generation probabilities (topic-word distribution)
- topic_counts
number of tokens assigned to each topic
- word_counts
number of times each word type appears
- doc_lens
length of each document in tokens
- vocab
words in the vocabulary (a vector of unique words)
- priors
priors
- options
options
- keywords_raw
specified keywords
- model_fit
perplexity and log-likelihood
- pi
estimated
\pi
(the probability of using keyword topic word distribution) for the last iteration- values_iter
values stored during iterations
- kept_values
outputs you specified to store in
keep
option- information
information about the fitting
See Also
https://keyatm.github.io/keyATM/articles/pkgdown_files/Options.html
Examples
## 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)