I wish to apply cross-validation to an LDA algorithm to determine the number of topics (K). My doubt is regarding the evaluator, as I wish to use the log-likelihood. What do I set on .setEvaluator(????) when creating a cross validation?
// Define a simple LDA
val lda = new LDA()
.setMaxIter(10)
.setFeaturesCol("features")
// We use a ParamGridBuilder to construct a grid of parameters to search over.
val range = 1 to 20
val paramGrid = new ParamGridBuilder()
.addGrid(lda.k, range.toArray )
.build()
// Create a CrossValidator
val cv = new CrossValidator()
.setEstimator(lda)
.setEvaluator(????)
.setEstimatorParamMaps(paramGrid)
.setNumFolds(5)