(abstract) new LDAModel()
Latent Dirichlet Allocation (LDA) model.
This abstraction permits for different underlying representations,
including local and distributed data structures.
Methods
describeTopics(maxTermsPerTopicopt) → {Array.<module:eclairjs.Tuple2>}
Return the topics described by weighted terms.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
maxTermsPerTopic |
number |
<optional> |
Maximum number of terms to collect for each topic. (term indices, term weights in topic). Each topic's terms are sorted in order of decreasing weight. |
Returns:
Array over topics. Each topic is represented as a pair of matching arrays:
- Type
- Array.<module:eclairjs.Tuple2>
docConcentration() → {module:eclairjs/mllib/linalg.Vector}
Concentration parameter (commonly named "alpha") for the prior placed on documents'
distributions over topics ("theta").
This is the parameter to a Dirichlet distribution.
Returns:
k() → {number}
Returns:
- Type
- number
topicConcentration() → {number}
Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics'
distributions over terms.
This is the parameter to a symmetric Dirichlet distribution.
Note: The topics' distributions over terms are called "beta" in the original LDA paper
by Blei et al., but are called "phi" in many later papers such as Asuncion et al., 2009.
Returns:
- Type
- number
topicsMatrix() → {module:eclairjs/mllib/linalg.Matrix}
Inferred topics, where each topic is represented by a distribution over terms.
This is a matrix of size vocabSize x k, where each column is a topic.
No guarantees are given about the ordering of the topics.
Returns:
vocabSize() → {number}
Returns:
- Type
- number