train_model: DEPRICATED IN V0.1.1, see new example file. Run LDA on a...

Description Usage Arguments Value See Also Examples

Description

DEPRICATED IN V0.1.1, see new example file. Run LDA on a Mallet instance

Usage

1
2
3
train_model(topic.model, dataframe, n.topics, optFreq = 20, burnIn = 50,
  numRuns = 200, num.topwords = 5, datecolname = "date",
  journalVec = NA, yearRangeRule = NA)

Arguments

topic.model

topic.model usually taken from make_model, a Mallet object

dataframe

data.frame usually taken from prep_corpus, a data.frame with fields for text, journal, date

n.topics

numeric number of topics that we want from LDA

optFreq

numeric how often should mallet optimize parameters?

burnIn

numeric number of burn in iterations for LDA

numRuns

numeric total number of runs Mallet should run before finalizing a model

num.topwords

numeric number of words to display on topic labels

datecolname

string the name of the date column from dataframe

journalVec

vector a vector of the names of journals to be included. Must be identical to values that generated topic.model possibile examples are "Blast", "Egoist", "Poetry Magazine", "Freewoman", "NewFreewoman"

yearRangeRule

string the rule specifying which years are to be included. Can take values like "> 1900", "==1919", etc. Must be identical to values that generated topic.model

Value

a data.frame of topic frequencies by document that we can analyze and graph

See Also

prep_corpus, which creates the data.frame this function draws on make_model, which creates the mallet object this function uses

Examples

1
2
3
4
date_vec <- date_vec
dataframe <- stripped_xmlData
marsden_journals <- make_model(dataframe, 10, journalVec = c("Blast", "Egoist", "Freewoman", "NewFreewoman"))
marz.df <- train_model(marsden_journals, dataframe, c("Blast", "Egoist", "Freewoman", "NewFreewoman"))

mlinegar/litMagModelling documentation built on May 23, 2019, 2:12 a.m.