pyspark.mllib.clustering.
LDA
Train Latent Dirichlet Allocation (LDA) model.
New in version 1.5.0.
Methods
train(rdd[, k, maxIterations, …])
train
Train a LDA model.
Methods Documentation
pyspark.RDD
RDD of documents, which are tuples of document IDs and term (word) count vectors. The term count vectors are “bags of words” with a fixed-size vocabulary (where the vocabulary size is the length of the vector). Document IDs must be unique and >= 0.
Number of topics to infer, i.e., the number of soft cluster centers. (default: 10)
Maximum number of iterations allowed. (default: 20)
Concentration parameter (commonly named “alpha”) for the prior placed on documents’ distributions over topics (“theta”). (default: -1.0)
Concentration parameter (commonly named “beta” or “eta”) for the prior placed on topics’ distributions over terms. (default: -1.0)
Random seed for cluster initialization. Set as None to generate seed based on system time. (default: None)
Period (in iterations) between checkpoints. (default: 10)
LDAOptimizer used to perform the actual calculation. Currently “em”, “online” are supported. (default: “em”)