Learn R Programming

TopicTestlet (version 0.1.0)

ttm_perplexity: Calculate Perplexity for Different Topic Numbers

Description

Calculates the perplexity of LDA models over a range of K topics to help determine the optimal number of topics.

Usage

ttm_perplexity(text_vector, k_range = 2:5, seed = 1234)

Value

A data frame containing K and the corresponding perplexity score.

Arguments

text_vector

A character vector of aggregated student responses (length N).

k_range

A numeric vector indicating the number of topics to try (e.g., 2:10).

seed

Integer seed for reproducibility.