Github user iyounus commented on a diff in the pull request: https://github.com/apache/spark/pull/10274#discussion_r49543068 --- Diff: mllib/src/main/scala/org/apache/spark/ml/optim/WeightedLeastSquares.scala --- @@ -94,8 +110,7 @@ private[ml] class WeightedLeastSquares( if (standardizeFeatures) { lambda *= aVar(j - 2) } - if (standardizeLabel) { - // TODO: handle the case when bStd = 0 + if (standardizeLabel && bStd != 0) { --- End diff -- The `WeightedLeastSquares` class is private and its instantiated in `LinearRegression` class where `standerizeLabe` parameter is hard wired to be `true`. So, the user doesn't have any control on this parameter. We can throw an exception when `yStd` is zero and `regParam` is non-zero. But, if that is the case, then, why not to throw exception when `yStd` is zero regardless of what other parameters are? I cannot think of any interpretation of the model in this case. The option could be to simply log a warning when we don't standardize the label here. Let me know what you think.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org