RollingLDA {rollinglda} | R Documentation |
RollingLDA
Description
Performs a rolling version of Latent Dirichlet Allocation.
Usage
RollingLDA(...)
## Default S3 method:
RollingLDA(
texts,
dates,
chunks,
memory,
vocab.abs = 5L,
vocab.rel = 0,
vocab.fallback = 100L,
doc.abs = 0L,
memory.fallback = 0L,
init,
type = c("ldaprototype", "lda"),
id,
...
)
Arguments
... |
additional arguments passed to |
texts |
[ |
dates |
[ |
chunks |
[ |
memory |
[ |
vocab.abs |
[ |
vocab.rel |
[0,1] |
vocab.fallback |
[ |
doc.abs |
[ |
memory.fallback |
[ |
init |
[ |
type |
[ |
id |
[ |
Details
The function first computes a initial LDA model (using
LDARep
or LDAPrototype
).
Afterwards it models temporal chunks of texts with a specified memory for
initialization of each model 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:
as.RollingLDA()
,
getChunks()
,
updateRollingLDA()
Examples
roll_lda = RollingLDA(texts = economy_texts,
dates = economy_dates,
chunks = "quarter",
memory = "3 quarter",
init = "2008-07-03",
K = 10,
type = "lda")
roll_lda
getChunks(roll_lda)
getLDA(roll_lda)
roll_proto = RollingLDA(texts = economy_texts,
dates = economy_dates,
chunks = "quarter",
memory = "3 quarter",
init = "2007-07-03",
K = 10,
n = 12,
pm.backend = "socket",
ncpus = 2)
roll_proto
getChunks(roll_proto)
getLDA(roll_proto)