Description Usage Arguments Details Value See Also Examples
Gridsearch for optimal K for your STM/CTM
1 |
data |
Either a pooled dfm object returned by pool_tweets or
a named list of pre-processed tweets for stm modeling returned by |
search_space |
Vector with number of topics to compare different models. |
... |
Additional parameters passed to searchK |
Wrapper function around searchK
for pooled dfm objects returned by
pool_tweets and prepped stm documents returned by fit_stm
.
Plot with different metrics compared.
searchK
searchK
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
library(Twitmo)
# load tweets (included in package)
mytweets <- load_tweets(system.file("extdata", "tweets_20191027-141233.json", package = "Twitmo"))
# Pool tweets into longer pseudo-documents
pool <- pool_tweets(data = mytweets)
pooled_dfm <- pool$document_term_matrix
# compare different K for CTM
find_stm(pooled_dfm, search_space = seq(1, 10, 1))
# OR
# compare different K for STM
prepped_stm <- stm_model$prep
find_stm(prepped_stm, search_space = seq(4, 16, by = 2))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.