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

    https://github.com/apache/spark/pull/15893#discussion_r88767607
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
 ---
    @@ -586,15 +577,24 @@ class LogisticRegression @Since("1.2.0") (
                Note that the intercept in scaled space and original space is 
the same;
                as a result, no scaling is needed.
              */
    -        val rawCoefficients = state.x.toArray.clone()
    -        val coefficientArray = Array.tabulate(numCoefficientSets * 
numFeatures) { i =>
    -          val colMajorIndex = (i % numFeatures) * numCoefficientSets + i / 
numFeatures
    -          val featureIndex = i % numFeatures
    -          if (featuresStd(featureIndex) != 0.0) {
    -            rawCoefficients(colMajorIndex) / featuresStd(featureIndex)
    -          } else {
    -            0.0
    +        val allCoefficients = state.x.toArray.clone()
    +        val allCoefMatrix = new DenseMatrix(numCoefficientSets, 
numFeaturesPlusIntercept,
    +          allCoefficients)
    +        val denseCoefficientMatrix = new DenseMatrix(numCoefficientSets, 
numFeatures,
    +          new Array[Double](numCoefficientSets * numFeatures), 
isTransposed = true)
    +        val interceptVec = if ($(fitIntercept) || !isMultinomial) {
    --- End diff --
    
    Should we consistently use `interceptVector`?


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