Description Usage Arguments Value See Also Examples
DEPRICATED IN V0.1.1, see new example file. Run LDA on a Mallet instance
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)
|
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 |
a data.frame of topic frequencies by document that we can analyze and graph
prep_corpus
, which creates the data.frame this function draws on
make_model
, which creates the mallet object this function uses
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.