Skip to contents

Optimal number of topics

Parametric selection of the topic count that best describes the corpus.

optop_select() optimal_topic()
Select the optimal number of topics from a pool of topic models

Goodness-of-fit indices

Regression-style discrepancy indices and grid summaries for topic-model fits.

optop_index_se() optop_index_chisq() optop_index_deviance()
OpTop goodness-of-fit indices for a single topic model
optop_index_table()
OpTop goodness-of-fit indices table across a grid of LDA models

Harmonized comparisons across K

Fixed partition and baseline so all indices share a common support.

optop_make_partition()
Harmonized Rare-word Partition for OpTop indices
optop_make_baseline()
Global Corpus Baseline for OpTop Indices

Held-out validation and diagnostics

Score independent evaluation documents, select the smallest sufficient K, and test for structured residual bias.

optop_index_holdout()
Held-out goodness-of-fit indices with conditional inference
optop_gain_table()
Adjacent held-out gains and the epsilon-adequacy selection
optop_crossfit()
V-fold cross-fitted discrepancy indices
optop_moment_test()
Held-out moment-based specification tests

Utilities

Simulate corpora, shard very large ones, wrap external engines, and align inputs.

sim_dfm()
Simulate a document-feature matrix from an LDA specification
optop_corpus()
Sharded corpus for very large document sets
optop_warplda()
Wrap a text2vec WarpLDA fit for OpTop
optop_model()
Build an OpTop model from bare weight matrices
optop_align_dtm_to_models()
Align a document-term matrix to a grid of fitted models

Methods

Console summaries and plots for the objects OpTop returns.