bscan commented on a change in pull request #23705: [SPARK-26787] Fix 
standardizeLabels error message in WeightedLeastSquares
URL: https://github.com/apache/spark/pull/23705#discussion_r252782228
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala
 ##########
 @@ -133,7 +133,8 @@ private[ml] class WeightedLeastSquares(
         return new WeightedLeastSquaresModel(coefficients, intercept, 
diagInvAtWA, Array(0D))
       } else {
         require(!(regParam > 0.0 && standardizeLabel), "The standard deviation 
of the label is " +
-          "zero. Model cannot be regularized with standardization=true")
+          "zero. Model cannot be regularized with standardizeLabel=true " +
+          "(standardizeLabel is not exposed in the LinearRegression API)")
 
 Review comment:
   Good point. Since the primary way to get here is through calling 
LinearRegression(), I was trying to give the user a message that indicates it's 
a current limitation of the API, not the implementation/algorithm. I updated to 
your suggestion though as I do think it's an improvement over the current 
message of `standardization=true`, which was simply incorrect. Thanks for 
reviewing!

----------------------------------------------------------------
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]

Reply via email to