Skip to contents

Topics have no fixed order: topic 3 of one run may be topic 12 of another. The topics of model_b are matched one-to-one to those of model_a so as to maximise the total cosine similarity of their word distributions (assignment problem, Hungarian method; Kuhn 1955), as in the stability analyses of Greene et al. (2014) and Roberts, Stewart and Tingley (2016).

Usage

match_topics(model_a, model_b, n_terms = 10L, ...)

Arguments

model_a, model_b

Fitted models with the same number of topics and the same vocabulary.

n_terms

Number of top words compared for the jaccard overlap.

...

Not used: an argument renamed in the development version of mintR gives an error naming its replacement, any other one an error.

Value

A data.table with topic_a, topic_b, cosine (similarity of the word distributions) and jaccard (overlap of the n_terms top words: shared / union).

References

Kuhn, H. W. (1955). The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1-2), 83-97.