score_models: Score Models Using Scores from 'ldatuning' Package

Description Usage Arguments Value

Description

Replaces FindTopicsNumber from ldatuning package. Takes topicmodels LDA output models and topic count and returns several scores of the clustering fit.

Usage

1
2
score_models(models, dtm, topics = seq(10, 40, by = 10),
  metrics = c("CaoJuan2009", "Arun2010", "Deveaud2014"), verbose = FALSE)

Arguments

dtm

An object of class "DocumentTermMatrix" with term-frequency weighting or an object coercible to a "simple_triplet_matrix" with integer entries.

topics

Vvector with number of topics to compare different models.

metrics

String or vector of possible metrics: "Griffiths2004", "CaoJuan2009", "Arun2010", "Deveaud2014".

verbose

Logical; Print status updates.

mc.cores

Integer; The number of CPU cores to processes models simultaneously.

Value

Data-frame with one or more metrics. numbers of topics and corresponding values of metric. Can be directly used by FindTopicsNumber_plot to draw a plot.


nateaff/legolda documentation built on May 18, 2019, 10:15 a.m.