Topic models are fitted by optimising a non-convex
objective: different initialisations can give different topics (Roberts,
Stewart and Tingley 2016). A topic worth interpreting should come back
when the model is refitted. Given several runs of the same model (same
corpus and K, different seeds), each run's topics are matched to those of
a reference run (match_topics()) and the similarity of matched topics
is averaged (Greene, O'Callaghan and Cunningham 2014).
Arguments
- models
A list of fitted models (same corpus, vocabulary and K), e.g. fitted with
init.type = "LDA"or"Random"and different seeds (spectral initialisation is deterministic: its runs are identical).- reference
Index of the reference run. Default: the run with the highest variational bound (the "best" run, as
stm::selectModel()would keep).- n_terms
Number of top words for the
jaccardoverlap.- ...
Not used: an argument renamed in the development version of mintR gives an error naming its replacement, any other one an error.
Value
A list with:
topics: one row per topic of the reference run, withstability_cosineandstability_jaccard(means over the other runs) andmin_cosine(worst run);model: one row, withstability_cosineandstability_jaccardaveraged over topics, andreference.
References
Greene, D., O'Callaghan, D. and Cunningham, P. (2014). How many topics? Stability analysis for topic models. Machine Learning and Knowledge Discovery in Databases (ECML PKDD 2014), 498-513.
Roberts, M. E., Stewart, B. M. and Tingley, D. (2016). Navigating the local modes of big data: The case of topic models. In R. M. Alvarez (ed.), Computational Social Science: Discovery and Prediction, Cambridge University Press, 51-97.
