updateRollingLDA {rollinglda} | R Documentation |
Updating an existing RollingLDA object
Description
Performs an update of an existing object consisting of a rolling version of Latent Dirichlet Allocation.
Usage
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,
...
)
Arguments
x |
[ |
texts |
[ |
dates |
[ |
chunks |
[ |
memory |
[ |
param |
[
|
compute.topics |
[ |
memory.fallback |
[ |
... |
not implemented |
Details
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
).
Value
[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. SeeLDAprep
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 forvocab.abs
[integer(1)
],vocab.rel
[0,1],vocab.fallback
[integer(1)
] anddoc.abs
[integer(1)
]. See above for explanation.
See Also
Other RollingLDA functions:
RollingLDA()
,
as.RollingLDA()
,
getChunks()
Examples
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)