Use Bayes' rule to get P(topic|token) from the estimated parameters of a
probabilistic topic model.This resulting "lambda" matrix can be used for
classifying new documents in a frequentist context and supports
augment.
calc_lambda(beta, theta, p_docs = NULL, correct = TRUE)Returns a matrix whose rows correspond to topics and whose columns
correspond to tokens. The i,j entry corresponds to P(topic_i|token_j)
a beta matrix
a theta matrix
A numeric vector of length nrow(theta) that is
proportional to the number of terms in each document, defaults to NULL.
Logical. Do you want to set NAs or NaNs in the final result to
zero? Useful when hitting computational underflow. Defaults to TRUE.
Set to FALSE for troubleshooting or diagnostics.