View source: R/compare_solutions.R
compare_solutions | R Documentation |
Pair-Wisely Compare Topic Solutions with Jaccard
compare_solutions(models, depth = 100)
models |
A list object with STM models. Must be at least 2 models. |
depth |
The number of top terms to use for comparison. Default is top 100 terms. |
A tibble with model-to-model topic-to-topic Jaccard similarity.
library(stm)
library(dplyr)
modA <- stm(poliblog5k.docs,
poliblog5k.voc, K=25,
prevalence=~rating,
data=poliblog5k.meta,
max.em.its=2,
init.type="Random",
seed = 9934)
modB <- stm(poliblog5k.docs,
poliblog5k.voc, K=25,
prevalence=~rating,
data=poliblog5k.meta,
max.em.its=2,
init.type="Random",
seed = 9576)
compare_solutions(list(modA, modB), depth=100) |>
arrange(desc(jaccard)) |>
head()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.