imatiach-msft commented on a change in pull request #21632:
[SPARK-19591][ML][MLlib] Add sample weights to decision trees
URL: https://github.com/apache/spark/pull/21632#discussion_r249640203
##########
File path:
mllib/src/test/scala/org/apache/spark/ml/regression/LinearRegressionSuite.scala
##########
@@ -891,6 +891,7 @@ class LinearRegressionSuite extends MLTest with
DefaultReadWriteTest with PMMLRe
.setStandardization(standardization)
.setRegParam(regParam)
.setElasticNetParam(elasticNetParam)
+ .setSolver(solver)
Review comment:
it is intentional, it is a minor fix to a test case which loops over solvers
but doesn't actually set them (so it is an unintentional test bug, the test is
rerunning the same duplicate code multiple times and doesn't test all solvers),
it helps to see the full test case code to understand the context of the fix:
```
// For squaredError loss
for (solver <- Seq("auto", "l-bfgs", "normal");
(elasticNetParam, regParam, fitIntercept, standardization) <-
testParams) {
val estimator = new LinearRegression()
.setFitIntercept(fitIntercept)
.setStandardization(standardization)
.setRegParam(regParam)
.setElasticNetParam(elasticNetParam)
.setSolver(solver)
MLTestingUtils.testArbitrarilyScaledWeights[LinearRegressionModel,
LinearRegression](
datasetWithStrongNoise.as[LabeledPoint], estimator, modelEquals)
MLTestingUtils.testOutliersWithSmallWeights[LinearRegressionModel,
LinearRegression](
datasetWithStrongNoise.as[LabeledPoint], estimator, numClasses,
modelEquals,
outlierRatio = 3)
MLTestingUtils.testOversamplingVsWeighting[LinearRegressionModel,
LinearRegression](
datasetWithStrongNoise.as[LabeledPoint], estimator, modelEquals,
seed)
}
```
I can create a separate PR just for this fix if you prefer and remove it in
this PR
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]