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

    https://github.com/apache/spark/pull/17078#discussion_r103342093
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
 ---
    @@ -1447,7 +1447,7 @@ private class LogisticAggregator(
           label: Double): Unit = {
     
         val localFeaturesStd = bcFeaturesStd.value
    -    val localCoefficients = bcCoefficients.value
    +    val localCoefficients = bcCoefficients.value.toArray
    --- End diff --
    
    My concern is that if `coefficients` is sparse, we are not just doing the 
pointer indirection but creating a new dense array from sparse matrix. I know 
we always pass in a dense matrix so this will not be an issue now, but being 
said that, in the following code, if we call `compress` in the `coefficients`, 
we may be able to broadcast a smaller object when L1 is applied or in the 
initial iteration that most of the elements in `coefficients` are zero.
    
    
https://github.com/sethah/spark/blob/3bea389f6780e1fd0385fbe26954fa4f59b69e37/mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala#L1674


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