run_LDA: Run LDA

Description Usage Arguments Value Author(s) Examples

Description

Run LDA

Usage

1
run_LDA(df, topic_num, seed_num = 731, topic_term_n = NULL, q = NULL)

Arguments

df

The document-term data_frame output from create_DTM

topic_num

An integer specifying the number of topics

seed_num

An integer specifying the random seed in the algorithm

topic_term_n

An integer sepcifying how many most frequent words within each topic to display. If default to NULL, then don't plot

q

A numeric specifying the quantile of tf-idf to remove words. If default to NULL, then don't remove

Value

A list of the beat matrix, the gamma matrix, and the topic-term histogram

Author(s)

Jiacheng He

Examples

1
2
3
4
run_LDA(text, 6)

lda_output <- run_LDA(text, 6, seed_num = 731, topic_term_n = 20)
print(lda_output$topic_term_plot)

JiachengHe/TextAnalysis documentation built on May 28, 2019, 7:51 a.m.