weightedLDA: Weighted LDA Main function

Description Usage Arguments Value Examples

View source: R/keyATM.R

Description

Run weighted LDA models.

Usage

1
2
weightedLDA(docs, model, number_of_topics, model_settings = list(),
  priors = list(), options = list(), keep = c())

Arguments

docs

texts read via keyATM_read()

model

Weighted LDA model: "base", "covariates", and "dynamic"

number_of_topics

the number of regular topics

model_settings

a list of model specific settings

priors

a list of priors of parameters

options

a list of options

keep

a vector of the names of elements you want to keep in output

Value

A keyATM_output object containing:

number_of_topics

Number of regular unseeded topics

V

Number of word types

N

Number of documents

theta

Normalized topic proportions for each document

phi

Normalized topic specific word generation probabilities

topic_counts

Number of tokens assigned to each topic

word_counts

Number of times each word type appears

doc_lens

Length of each document in tokens

vocab

Words in the vocabulary

model_fit

Perplexity and log-likelihood

p

Estimated p

values_iter

Organized values stored during iterations

kept_values

Outputs you specified to store.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
  # Weighted LDA
  out <- weightedLDA(
                     keyATM_docs, model = "base", number_of_topics = 5
                    )

  # Weighted LDA Covariates
  out <- weightedLDA(
                     keyATM_docs, model = "covariates", number_of_topics = 5,
                     model_settings(covariates_data = cov_matrix)
                    )                   

  # Weighted LDA Dynamic
  out <- weightedLDA(
                     keyATM_docs, model = "dynamic", number_of_topics = 5,
                     model_settings(time_index = time_index_vec, num_states = 5)
                    )


## End(Not run)

Shusei-E/keyATM-OLD documentation built on Dec. 23, 2019, 6:42 p.m.