Repository: spark Updated Branches: refs/heads/branch-2.1 3ec3e3f2e -> 29b954bba
[SPARK-19066][SPARKR][BACKPORT-2.1] LDA doesn't set optimizer correctly ## What changes were proposed in this pull request? Back port the fix to SPARK-19066 to 2.1 branch. ## How was this patch tested? Unit tests Author: wm...@hotmail.com <wm...@hotmail.com> Closes #16623 from wangmiao1981/bugport. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/29b954bb Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/29b954bb Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/29b954bb Branch: refs/heads/branch-2.1 Commit: 29b954bba1a9fa6e3bd823fa36ea7df4c2461381 Parents: 3ec3e3f Author: wm...@hotmail.com <wm...@hotmail.com> Authored: Tue Jan 17 21:24:33 2017 -0800 Committer: Felix Cheung <felixche...@apache.org> Committed: Tue Jan 17 21:24:33 2017 -0800 ---------------------------------------------------------------------- R/pkg/inst/tests/testthat/test_mllib.R | 4 ++-- mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/29b954bb/R/pkg/inst/tests/testthat/test_mllib.R ---------------------------------------------------------------------- diff --git a/R/pkg/inst/tests/testthat/test_mllib.R b/R/pkg/inst/tests/testthat/test_mllib.R index 1f2fae9..3891f00 100644 --- a/R/pkg/inst/tests/testthat/test_mllib.R +++ b/R/pkg/inst/tests/testthat/test_mllib.R @@ -860,7 +860,7 @@ test_that("spark.lda with libsvm", { weights <- stats$topicTopTermsWeights vocabulary <- stats$vocabulary - expect_false(isDistributed) + expect_true(isDistributed) expect_true(logLikelihood <= 0 & is.finite(logLikelihood)) expect_true(logPerplexity >= 0 & is.finite(logPerplexity)) expect_equal(vocabSize, 11) @@ -874,7 +874,7 @@ test_that("spark.lda with libsvm", { model2 <- read.ml(modelPath) stats2 <- summary(model2) - expect_false(stats2$isDistributed) + expect_true(stats2$isDistributed) expect_equal(logLikelihood, stats2$logLikelihood) expect_equal(logPerplexity, stats2$logPerplexity) expect_equal(vocabSize, stats2$vocabSize) http://git-wip-us.apache.org/repos/asf/spark/blob/29b954bb/mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala ---------------------------------------------------------------------- diff --git a/mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala b/mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala index cbe6a70..e7851e1 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/r/LDAWrapper.scala @@ -122,6 +122,7 @@ private[r] object LDAWrapper extends MLReadable[LDAWrapper] { .setK(k) .setMaxIter(maxIter) .setSubsamplingRate(subsamplingRate) + .setOptimizer(optimizer) val featureSchema = data.schema(features) val stages = featureSchema.dataType match { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org