diff options
author | Yanbo Liang <ybliang8@gmail.com> | 2016-10-25 10:22:02 -0700 |
---|---|---|
committer | Yanbo Liang <ybliang8@gmail.com> | 2016-10-25 10:22:02 -0700 |
commit | ac8ff920faec6ee06e17212e2b5d2ee117495e87 (patch) | |
tree | f9e11076efc093b3370e559bd9ec0e5475e982a2 /mllib | |
parent | 38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53 (diff) | |
download | spark-ac8ff920faec6ee06e17212e2b5d2ee117495e87.tar.gz spark-ac8ff920faec6ee06e17212e2b5d2ee117495e87.tar.bz2 spark-ac8ff920faec6ee06e17212e2b5d2ee117495e87.zip |
[SPARK-17748][FOLLOW-UP][ML] Fix build error for Scala 2.10.
## What changes were proposed in this pull request?
#15394 introduced build error for Scala 2.10, this PR fix it.
## How was this patch tested?
Existing test.
Author: Yanbo Liang <ybliang8@gmail.com>
Closes #15625 from yanboliang/spark-17748-scala.
Diffstat (limited to 'mllib')
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala index 5f638b4880..3cdab03279 100644 --- a/mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala @@ -280,7 +280,7 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext } // Cholesky also fails when regularization is added but we don't wish to standardize - val wls = new WeightedLeastSquares(true, regParam = 0.5, elasticNetParam = 0.0, + val wls = new WeightedLeastSquares(fitIntercept = true, regParam = 0.5, elasticNetParam = 0.0, standardizeFeatures = false, standardizeLabel = false, solverType = WeightedLeastSquares.Cholesky) intercept[SingularMatrixException] { @@ -470,10 +470,11 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext var idx = 0 for (fitIntercept <- Seq(false, true); regParam <- Seq(0.1, 0.5, 1.0); - standardizeFeatures <- Seq(false, true); + standardization <- Seq(false, true); elasticNetParam <- Seq(0.1, 0.5, 1.0)) { - val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam = elasticNetParam, - standardizeFeatures, standardizeLabel = true, solverType = WeightedLeastSquares.Auto) + val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam, + standardizeFeatures = standardization, standardizeLabel = true, + solverType = WeightedLeastSquares.Auto) .fit(instances) val actual = Vectors.dense(wls.intercept, wls.coefficients(0), wls.coefficients(1)) assert(actual ~== expected(idx) absTol 1e-4) @@ -528,10 +529,10 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext var idx = 0 for (fitIntercept <- Seq(false, true); regParam <- Seq(0.0, 0.1, 1.0); - standardizeFeatures <- Seq(false, true)) { + standardization <- Seq(false, true)) { for (solver <- WeightedLeastSquares.supportedSolvers) { val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam = 0.0, - standardizeFeatures, standardizeLabel = true, solverType = solver) + standardizeFeatures = standardization, standardizeLabel = true, solverType = solver) .fit(instances) val actual = Vectors.dense(wls.intercept, wls.coefficients(0), wls.coefficients(1)) assert(actual ~== expected(idx) absTol 1e-4) |