topic_entropy: Calculate the topic entropy

Description Usage Arguments Details Examples

Description

Calculate the topic entropy

Usage

1
topic_entropy(x, prior = 0)

Arguments

x

a tidy_topic_array.

prior

a smoothing constant to use (often alpha). Not currently implemented.

Details

Calculates the entropy over topics.

Assumes that of beta is set to 0 the probability 0 is the limit when p -> 0+ i.e 0.

Examples

1
2
3
4
data("sotu50")
dtm <- doc_topic_matrix(sotu50)
H_0 <- topic_entropy(x = dtm)
H_doc <- topic_entropy(x = dplyr::group_by(dtm, doc))

MansMeg/tidytopics documentation built on May 8, 2019, 3:52 p.m.