Learn R Programming

tidylda (version 0.0.7)

format_alpha: Format alpha For Input into fit_lda_c

Description

There are a bunch of ways users could format alpha but the C++ Gibbs sampler in fit_lda_c only takes it one way. This function does the appropriate formatting. It also returns errors if the user input a malformatted alpha.

Usage

format_alpha(alpha, k)

Value

Returns a list with two elements: alpha and alpha_class.

alpha is the post-formatted version of alpha in the form of a

k-length numeric vector. alpha_class is a character denoting whether or not the user-supplied alpha was a "scalar" or "vector".

Arguments

alpha

the prior for topics over documents. Can be a numeric scalar or numeric vector.

k

the number of topics.