Return the topics described by weighted terms.
Return the topics described by weighted terms.
Maximum number of terms to collect for each topic.
Array over topics. Each topic is represented as a pair of matching arrays: (term indices, term weights in topic). Each topic's terms are sorted in order of decreasing weight.
Return the topics described by weighted terms.
Return the topics described by weighted terms.
WARNING: If vocabSize and k are large, this can return a large object!
Array over topics. Each topic is represented as a pair of matching arrays: (term indices, term weights in topic). Each topic's terms are sorted in order of decreasing weight.
Concentration parameter (commonly named "alpha") for the prior placed on documents' distributions over topics ("theta").
Concentration parameter (commonly named "alpha") for the prior placed on documents' distributions over topics ("theta").
This is the parameter to a Dirichlet distribution.
Current version of model save/load format.
Current version of model save/load format.
Shape parameter for random initialization of variational parameter gamma.
Shape parameter for random initialization of variational parameter gamma. Used for variational inference for perplexity and other test-time computations.
Java-friendly version of topTopicsPerDocument
Java-friendly version of topTopicsPerDocument
Java-friendly version of topicAssignments
Java-friendly version of topicAssignments
Java-friendly version of topicDistributions
Java-friendly version of topicDistributions
Number of topics
Number of topics
Log likelihood of the observed tokens in the training set, given the current parameter estimates: log P(docs | topics, topic distributions for docs, alpha, eta)
Log likelihood of the observed tokens in the training set, given the current parameter estimates: log P(docs | topics, topic distributions for docs, alpha, eta)
Note:
Log probability of the current parameter estimate: log P(topics, topic distributions for docs | alpha, eta)
Log probability of the current parameter estimate: log P(topics, topic distributions for docs | alpha, eta)
Java-friendly version of topicDistributions
Java-friendly version of topicDistributions
Spark context used to save model data.
Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception.
Convert model to a local model.
Convert model to a local model. The local model stores the inferred topics but not the topic distributions for training documents.
Return the top documents for each topic
Return the top documents for each topic
Maximum number of documents to collect for each topic.
Array over topics. Each element represent as a pair of matching arrays: (IDs for the documents, weights of the topic in these documents). For each topic, documents are sorted in order of decreasing topic weights.
For each document, return the top k weighted topics for that document and their weights.
For each document, return the top k weighted topics for that document and their weights.
RDD of (doc ID, topic indices, topic weights)
Return the top topic for each (doc, term) pair.
Return the top topic for each (doc, term) pair. I.e., for each document, what is the most likely topic generating each term?
RDD of (doc ID, assignment of top topic index for each term), where the assignment is specified via a pair of zippable arrays (term indices, topic indices). Note that terms will be omitted if not present in the document.
Concentration parameter (commonly named "beta" or "eta") for the prior placed on topics' distributions over terms.
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.
For each document in the training set, return the distribution over topics for that document ("theta_doc").
For each document in the training set, return the distribution over topics for that document ("theta_doc").
RDD of (document ID, topic distribution) pairs
Inferred topics, where each topic is represented by a distribution over terms.
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.
WARNING: This matrix is collected from an RDD. Beware memory usage when vocabSize, k are large.
Vocabulary size (number of terms or terms in the vocabulary)
Vocabulary size (number of terms or terms in the vocabulary)
:: Experimental ::
Distributed LDA model. This model stores the inferred topics, the full training dataset, and the topic distributions. When computing topics for new documents, it may give more accurate answers than the LocalLDAModel.