Skip to contents

The model-level metrics of evaluate_topic_models() for a single model: means over topics of coherence and exclusivity, topic diversity, mean and maximum similarity between topics, and the ldatuning criteria. Held-out likelihood and residuals need a held-out sample and are computed by evaluate_topic_models().

Usage

model_metrics(
  model,
  documents,
  metrics = c("coherence", "exclusivity", "diversity", "similarity", "ldatuning"),
  n_terms = 10L,
  frexw = 0.7,
  n_diversity = 25L,
  ...
)

Arguments

model

A fitted stm model (or a list with beta$logbeta[[1]] and vocab).

documents

The documents the model was fitted on (stm format).

metrics

Character vector among "coherence", "exclusivity", "diversity", "similarity", "ldatuning".

n_terms

Integer scalar, number of top words per topic (M in stm).

frexw

FREX weight of exclusivity.

n_diversity

Number of top words used for diversity (25 in Dieng et al. 2020).

...

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

Value

A one-row data.table.