spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "AbderRahman Sobh (JIRA)" <>
Subject [jira] [Created] (SPARK-17950) Match SparseVector behavior with DenseVector
Date Sat, 15 Oct 2016 00:26:20 GMT
AbderRahman Sobh created SPARK-17950:

             Summary: Match SparseVector behavior with DenseVector
                 Key: SPARK-17950
             Project: Spark
          Issue Type: Improvement
          Components: MLlib, PySpark
    Affects Versions: 2.0.1
            Reporter: AbderRahman Sobh
            Priority: Minor

Simply added the `__getattr__` to SparseVector that DenseVector has, but calls self.toArray()
instead of storing a vector all the time in self.array

This allows for use of numpy functions on the values of a SparseVector in the same direct
way that users interact with DenseVectors.
 i.e. you can simply call SparseVector.mean() to average the values in the entire vector.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message