spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Owen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-9003) Add map/update function to MLlib/Vector
Date Sun, 12 Jul 2015 08:07:04 GMT

    [ https://issues.apache.org/jira/browse/SPARK-9003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623702#comment-14623702
] 

Sean Owen commented on SPARK-9003:
----------------------------------

I think the idea was that this is not supposed to become yet another vector/matrix library,
and that you can manipulate the underlying breeze vector if needed. I don't know how strong
that convention is. The use case you show doesn't really benefit except for maybe saving a
method call; is there a case where this would be a bigger win?

> Add map/update function to MLlib/Vector
> ---------------------------------------
>
>                 Key: SPARK-9003
>                 URL: https://issues.apache.org/jira/browse/SPARK-9003
>             Project: Spark
>          Issue Type: Improvement
>          Components: MLlib
>            Reporter: Yanbo Liang
>            Priority: Minor
>
> MLlib/Vector is short of map/update function which is inconvenience for some Vector operations.
> For example:
> val a = Vectors.dense(...)
> If we want to compute math.log for each elements of a and get Vector as return value,
we can only code as:
> val b = Vectors.dense(a.toArray.map(math.log))
> The code snippet is not elegant, we want it can implement:
> val c = a.map(math.log)
> Also currently MLlib/Matrix has implemented map/update function. I think Vector should
also has map/update.



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