spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shuo Xiang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-5116) Add extractor for SparseVector and DenseVector in MLlib
Date Wed, 07 Jan 2015 02:05:34 GMT
Shuo Xiang created SPARK-5116:
---------------------------------

             Summary: Add extractor for SparseVector and DenseVector in MLlib 
                 Key: SPARK-5116
                 URL: https://issues.apache.org/jira/browse/SPARK-5116
             Project: Spark
          Issue Type: New Feature
          Components: MLlib
            Reporter: Shuo Xiang
            Priority: Minor


Add extractor for SparseVector and DenseVector in MLlib to save some code while performing
pattern matching on Vectors. For example, previously we need to use:

vec match {
      case dv: DenseVector =>
        val values = dv.values
        ...
      case sv: SparseVector =>
        val indices = sv.indices
        val values = sv.values
        val size = sv.size
        ...
    }

with extractor it is:
vec match {
      case DenseVector(values) =>
        ...
      case SparseVector(size, indices, values) =>
        ...
    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message