spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MechCoder <...@git.apache.org>
Subject [GitHub] spark pull request: [Spark-7422][MLLIB] Add argmax to Vector, Spar...
Date Tue, 26 May 2015 15:23:12 GMT
Github user MechCoder commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6112#discussion_r31045378
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala ---
    @@ -717,6 +719,49 @@ class SparseVector(
           new SparseVector(size, ii, vv)
         }
       }
    +
    +  override def argmax: Int = {
    +    if (size == 0) {
    +      -1
    +    } else {
    +
    +      var maxIdx = 0
    +      var maxValue = if(indices(0) != 0) 0.0 else values(0)
    --- End diff --
    
    Can you please add a comment on why this initialization is done?


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