[ 
https://issues.apache.org/jira/browse/SPARK-5116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiangrui Meng updated SPARK-5116:
---------------------------------
    Assignee: Shuo Xiang

> 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
>            Assignee: Shuo Xiang
>            Priority: Minor
>             Fix For: 1.3.0
>
>
> 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:
> {code:title=A.scala|borderStyle=solid}
> vec match {
>       case dv: DenseVector =>
>         val values = dv.values
>         ...
>       case sv: SparseVector =>
>         val indices = sv.indices
>         val values = sv.values
>         val size = sv.size
>         ...
>     }
> {code}
> with extractor it is:
> {code:title=B.scala|borderStyle=solid}
> vec match {
>       case DenseVector(values) =>
>         ...
>       case SparseVector(size, indices, values) =>
>         ...
>     }
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to