fit_lda: Fit LDA-model

Description Usage Arguments Details Value See Also

View source: R/lda_miretrieve.R

Description

Fit LDA-model with k topics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fit_lda(
  df,
  k,
  stopwords = stopwords_miretrieve,
  method = "gibbs",
  control = NULL,
  seed = 42,
  col.abstract = Abstract,
  col.pmid = PMID
)

Arguments

df

Data frame containing abstracts and PubMed-IDs.

k

Integer. Number of topics to fit. Must be >=2.

stopwords

Data frame containing stop words.

method

String. Either "gibbs" or "VEM".

control

Control parameters for LDA modeling. For more information, see the documentation of the LDAcontrol class in the topicmodels package.

seed

Integer. Seed for reproducibility.

col.abstract

Column containing abstracts.

col.pmid

Column containing PubMed-ID.

Details

Fit LDA-model with k topics from a data frame. fit_lda() is based on LDA() from the package topicmodels.

Value

LDA-model.

See Also

plot_perplexity()

Other LDA functions: assign_topic_lda(), plot_lda_term(), plot_perplexity()


JulFriedrich/miRetrieve documentation built on Sept. 20, 2021, 11:37 p.m.