You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiangrui Meng (JIRA)" <ji...@apache.org> on 2015/01/08 08:23:35 UTC
[jira] [Resolved] (SPARK-5116) Add extractor for SparseVector and
DenseVector in MLlib
[ https://issues.apache.org/jira/browse/SPARK-5116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xiangrui Meng resolved SPARK-5116.
----------------------------------
Resolution: Fixed
Fix Version/s: 1.3.0
Issue resolved by pull request 3919
[https://github.com/apache/spark/pull/3919]
> 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
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org