Github user coderxiang commented on a diff in the pull request: https://github.com/apache/spark/pull/10940#discussion_r51052438 --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala --- @@ -341,11 +341,11 @@ class LogisticRegression @Since("1.2.0") ( regParamL1 } else { // If `standardization` is false, we still standardize the data - // to improve the rate of convergence; as a result, we have to - // perform this reverse standardization by penalizing each component - // differently to get effectively the same objective function when + // to improve the rate of convergence unless the standard deviation is zero; + // as a result, we have to perform this reverse standardization by penalizing + // each component differently to get effectively the same objective function when // the training dataset is not standardized. - if (featuresStd(index) != 0.0) regParamL1 / featuresStd(index) else 0.0 + if (featuresStd(index) != 0.0) regParamL1 / featuresStd(index) else regParamL1 --- End diff -- Can you give an example that using `value` will fail to converge? I agree any non-zero number here can make the algorithm work, but should we select a particular number as the denominator, or let it be the original value? @mengxr what do 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