Description Usage Arguments Value Author(s) See Also
Create a topic model from a document-to-term matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | create_stm(
dtm,
topic_nbr = 0,
prevalence = NULL,
content = NULL,
init_type = "Spectral",
seed = 1234,
iterations = 50,
tolerance = 0,
keywords = NULL,
baselab = "prob",
frexweight = 0.6,
min_gamma = 0.1,
min_beta = 0.01,
min_common = 1,
verbose = TRUE
)
|
dtm |
Document-to-Term matrix. |
topic_nbr |
Numeric. Number of topics to model. |
prevalence |
Formula. See the stm function for detailed instructions. |
content |
Formula. See the stm function for detailed instructions. |
init_type |
Character string. See the stm function for detailed instructions. |
seed |
Numeric. Seed for initialization. |
iterations |
Integer. Maximum number of iteration. |
tolerance |
Numeric. See the stm function for detailed instructions. |
keywords |
Tibble. Two variables: one for the "document" and one of the related "keywords". |
baselab |
Character string. Whether labels should be based on "prob", "frex", "lift", or "score". |
frexweight |
Numeric. The weight on discriminance in term selection. |
min_gamma |
Numeric. Minimum strength of the relationship between document and topic. |
min_beta |
Numeric. Minimum strength of the relationship between term and topic. |
min_common |
Integer. Maximum number of topics allowed per document. |
verbose |
Logical. Should messages be printed. |
A list with the "topic_model", the "topic_term", the "topic_label", and the "topic_document".
Nicolas Mangin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.