Skip to content

Commit ac8ff92

Browse files
committed
[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.
1 parent 38cdd6c commit ac8ff92

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mllib/src/test/scala/org/apache/spark/ml/optim/WeightedLeastSquaresSuite.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext
280280
}
281281

282282
// Cholesky also fails when regularization is added but we don't wish to standardize
283-
val wls = new WeightedLeastSquares(true, regParam = 0.5, elasticNetParam = 0.0,
283+
val wls = new WeightedLeastSquares(fitIntercept = true, regParam = 0.5, elasticNetParam = 0.0,
284284
standardizeFeatures = false, standardizeLabel = false,
285285
solverType = WeightedLeastSquares.Cholesky)
286286
intercept[SingularMatrixException] {
@@ -470,10 +470,11 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext
470470
var idx = 0
471471
for (fitIntercept <- Seq(false, true);
472472
regParam <- Seq(0.1, 0.5, 1.0);
473-
standardizeFeatures <- Seq(false, true);
473+
standardization <- Seq(false, true);
474474
elasticNetParam <- Seq(0.1, 0.5, 1.0)) {
475-
val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam = elasticNetParam,
476-
standardizeFeatures, standardizeLabel = true, solverType = WeightedLeastSquares.Auto)
475+
val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam,
476+
standardizeFeatures = standardization, standardizeLabel = true,
477+
solverType = WeightedLeastSquares.Auto)
477478
.fit(instances)
478479
val actual = Vectors.dense(wls.intercept, wls.coefficients(0), wls.coefficients(1))
479480
assert(actual ~== expected(idx) absTol 1e-4)
@@ -528,10 +529,10 @@ class WeightedLeastSquaresSuite extends SparkFunSuite with MLlibTestSparkContext
528529
var idx = 0
529530
for (fitIntercept <- Seq(false, true);
530531
regParam <- Seq(0.0, 0.1, 1.0);
531-
standardizeFeatures <- Seq(false, true)) {
532+
standardization <- Seq(false, true)) {
532533
for (solver <- WeightedLeastSquares.supportedSolvers) {
533534
val wls = new WeightedLeastSquares(fitIntercept, regParam, elasticNetParam = 0.0,
534-
standardizeFeatures, standardizeLabel = true, solverType = solver)
535+
standardizeFeatures = standardization, standardizeLabel = true, solverType = solver)
535536
.fit(instances)
536537
val actual = Vectors.dense(wls.intercept, wls.coefficients(0), wls.coefficients(1))
537538
assert(actual ~== expected(idx) absTol 1e-4)

0 commit comments

Comments
 (0)