I can train, but not suitable. Object "LDA" does not have the attribute "fit"
This is because you are working with an old, RDD (MLlib) based API , i.e.
from pyspark.mllib.clustering import LDA
the class LDAreally doesn't include fit, logLikelihoodor logPerplexity.
, , API (ML):
from pyspark.ml.clustering import LDA
dataset = (spark.read.format("libsvm")
.load("data/mllib/sample_lda_libsvm_data.txt"))
lda = LDA(k=10, maxIter=10)
model = lda.fit(dataset)
ll = model.logLikelihood(dataset)
lp = model.logPerplexity(dataset)