spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbtsai <...@git.apache.org>
Subject [GitHub] spark pull request #13796: [SPARK-7159][ML] Add multiclass logistic regressi...
Date Fri, 12 Aug 2016 18:16:26 GMT
Github user dbtsai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13796#discussion_r74636502
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
    @@ -944,13 +955,140 @@ class BinaryLogisticRegressionSummary private[classification] (
     private class LogisticAggregator(
         private val numFeatures: Int,
         numClasses: Int,
    -    fitIntercept: Boolean) extends Serializable {
    +    fitIntercept: Boolean,
    +    multinomial: Boolean,
    +    standardize: Boolean) extends Serializable {
     
       private var weightSum = 0.0
       private var lossSum = 0.0
     
    +  private val totalCoefficientLength = {
    +    val cols = if (fitIntercept) numFeatures + 1 else numFeatures
    +    val rows = if (multinomial) numClasses else math.max(1, numClasses - 1)
    +    rows * cols
    +  }
    +
       private val gradientSumArray =
    -    Array.ofDim[Double](if (fitIntercept) numFeatures + 1 else numFeatures)
    +    Array.ofDim[Double](totalCoefficientLength)
    --- End diff --
    
    Move it up to previous line.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message