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

    https://github.com/apache/spark/pull/10788#discussion_r50369141
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
 ---
    @@ -335,31 +342,45 @@ class LogisticRegression @Since("1.2.0") (
             val initialCoefficientsWithIntercept =
               Vectors.zeros(if ($(fitIntercept)) numFeatures + 1 else 
numFeatures)
     
    -        if ($(fitIntercept)) {
    -          /*
    -             For binary logistic regression, when we initialize the 
coefficients as zeros,
    -             it will converge faster if we initialize the intercept such 
that
    -             it follows the distribution of the labels.
    -
    -             {{{
    -               P(0) = 1 / (1 + \exp(b)), and
    -               P(1) = \exp(b) / (1 + \exp(b))
    -             }}}, hence
    -             {{{
    -               b = \log{P(1) / P(0)} = \log{count_1 / count_0}
    -             }}}
    +        if (optInitialModel.isDefined && optInitialModel.get.coefficients 
!= numFeatures) {
    +          val vec = optInitialModel.get.coefficients
    --- End diff --
    
    `vec` is not used.


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

Reply via email to