View source: R/updateRollingLDA.R
updateRollingLDA | R Documentation |
Performs an update of an existing object consisting of a rolling version of Latent Dirichlet Allocation.
updateRollingLDA( x, texts, dates, chunks, memory, param = getParam(x), compute.topics = TRUE, memory.fallback = 0L, ... ) ## S3 method for class 'RollingLDA' RollingLDA( x, texts, dates, chunks, memory, param = getParam(x), compute.topics = TRUE, memory.fallback = 0L, ... )
x |
[ |
texts |
[ |
dates |
[ |
chunks |
[ |
memory |
[ |
param |
[
|
compute.topics |
[ |
memory.fallback |
[ |
... |
not implemented |
The function uses an existing RollingLDA
object and
models new texts with a specified memory as initialization of the new LDA chunk.
The function returns a RollingLDA
object. You can receive results and
all other elements of this object with getter functions (see getChunks
).
[named list
] with entries
id
[character(1)
] See above.
lda
LDA
object of the fitted RollingLDA.
docs
[named list
] with modeled texts in a preprocessed format.
See LDAprep
dates
[named Date
] with dates of the modeled texts.
vocab
[character
] with the vocabularies considered
for modeling.
chunks
[data.table
] with specifications for each
model chunk.
param
[named list
] with parameter specifications for
vocab.abs
[integer(1)
], vocab.rel
[0,1],
vocab.fallback
[integer(1)
] and
doc.abs
[integer(1)
]. See above for explanation.
Other RollingLDA functions:
RollingLDA()
,
as.RollingLDA()
,
getChunks()
roll_lda = RollingLDA(texts = economy_texts[economy_dates < "2008-05-01"], dates = economy_dates[economy_dates < "2008-05-01"], chunks = "month", memory = "month", init = 100, K = 10, type = "lda") # updateRollingLDA = RollingLDA, if first argument is a RollingLDA object roll_update = RollingLDA(roll_lda, texts = economy_texts[economy_dates >= "2008-05-01"], dates = economy_dates[economy_dates >= "2008-05-01"], chunks = "month", memory = "month") roll_update getChunks(roll_update)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.