Github user dbtsai commented on a diff in the pull request:
https://github.com/apache/spark/pull/10940#discussion_r51052743
--- 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 --
BTW, this technique is already used here by dividing the std of feature.
Note that you need to make sure `value != 0`, and if `value == 0`, the
coefficient of that feature will be zero.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]