Given a tidied dataframe of topic-doc or word-topic distributions and a target entropy, find the mean exponent needed to adjust the temperature of each distribution to approximately match the target entropy.
Usage
target_power(tidy_df, group_col, p_col, target_entropy)
Arguments
- tidy_df
The tidied distribution dataframe
- p_col
Column containing the probability for each category (eg, word) conditional on the group (eg, topic)
- target_entropy
Target entropy
- Grouping
column, RHS of the conditional probability distribution, eg, topics for word-topic distributions
Value
Mean exponent to renormalize to the target entropy