Learn R Programming

saotd (version 0.3.1)

number_topics: Number Topics

Description

Determines the optimal number of Latent topics within a data frame by tuning the Latent Dirichlet Allocation (LDA) model parameters. Uses the `ldatuning` package and outputs an ldatuning plot. __This process can be time consuming depending on the size of the input data frame.__

Usage

number_topics(
  DataFrame,
  num_cores = 1L,
  min_clusters = 2,
  max_clusters = 12,
  skip = 2,
  set_seed = 1234
)

Value

A Tidy DataFrame.

Arguments

DataFrame

Data Frame of Twitter Data.

num_cores

The number of CPU cores to processes models simultaneously (2L for dual core processor).

min_clusters

Lower range for the number of clusters.

max_clusters

Upper range for the number of clusters.

skip

Integer; The number of clusters to skip between entries.

set_seed

Seed for reproducible results.

Examples

Run this code
if (FALSE) {
library(saotd)
data <- raw_tweets
LDA_Topic_Plot <- number_topics(DataFrame = data,
                                num_cores = 2L,
                                min_clusters = 2,
                                max_clusters = 12, 
                                skip = 2,
                                set_seed = 1234)

LDA_Topic_Plot 
}

Run the code above in your browser using DataLab