Github user holdenk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7080#discussion_r33505540
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
 ---
    @@ -149,15 +158,26 @@ class LogisticRegression(override val uid: String)
         val regParamL1 = $(elasticNetParam) * $(regParam)
         val regParamL2 = (1.0 - $(elasticNetParam)) * $(regParam)
     
    -    val costFun = new LogisticCostFun(instances, numClasses, 
$(fitIntercept),
    +    val costFun = new LogisticCostFun(instances, numClasses, 
$(fitIntercept), $(standardization),
           featuresStd, featuresMean, regParamL2)
     
         val optimizer = if ($(elasticNetParam) == 0.0 || $(regParam) == 0.0) {
           new BreezeLBFGS[BDV[Double]]($(maxIter), 10, $(tol))
         } else {
    -      // Remove the L1 penalization on the intercept
           def regParamL1Fun = (index: Int) => {
    -        if (index == numFeatures) 0.0 else regParamL1
    +        // Remove the L1 penalization on the intercept
    +        if (index == numFeatures) 0.0 else {
    +          if ($(standardization)) {
    +            regParamL1
    +          } else {
    +            if (featuresStd(index) != 0.0) {
    +              // If `standardization` is false, each component is 
penalized differently to
    --- End diff --
    
    Maybe mention that the data is standardized, which is why we are performing 
this reverse standardization for this?


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

Reply via email to