calc_lambda {tidylda} | R Documentation |
Calculate a matrix whose rows represent P(topic_i|tokens)
Description
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
.
Usage
calc_lambda(beta, theta, p_docs = NULL, correct = TRUE)
Arguments
beta |
a beta matrix |
theta |
a theta matrix |
p_docs |
A numeric vector of length |
correct |
Logical. Do you want to set NAs or NaNs in the final result to
zero? Useful when hitting computational underflow. Defaults to |
Value
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)
[Package tidylda version 0.0.5 Index]