train: train for 'tmCorpus' object

Description Usage Arguments

Description

#' Function to create train Topic Model #' #' @param x tmCorpus object #' @param ... settings for mallet.doc.topics and mallet.topic.words #' #' @return returns object of a class tmTopicModel #' #' @export train <- function(x, ...) UseMethod("train")

Usage

1
2
3
4
5
6
7
## S3 method for class 'tmCorpus'
train(x, k = 20, stoplist_file = "en.txt",
  token_regexp = regexp_token, alpha_opt = 20, burn_in = 50,
  train = 200, maximize = 10, package = "mallet", ...)

## S3 method for class 'DocumentTermMatrix'
train(x, k = 20, ...)

Arguments

x

A tmCorpus object or DocumentTermMatrix object

k

number of topics

stoplist_file

file direcroty or vector of stopwords

token_regexp

regular expression token

alpha_opt

mallet LDA topic model parameter

burn_in

mallet LDA topic model parameter

train

mallet LDA topic model parameter

maximize

mallet LDA topic model parameter

package

package to train topic mdoel can be set to "mallet" or "topicmodels"

...

other model arguments


textmining documentation built on May 2, 2019, 6:47 a.m.