Learn R Programming

saotd (version 0.2.0)

number_topics: Number Topics

Description

Determines the optimal number of Latent topics within a dataframe 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 dataframe.__

Usage

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

Arguments

DataFrame

DataFrame 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 reproducable results.

Value

A Tidy DataFrame.

Examples

Run this code
# NOT RUN {
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