Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Incomplete
-
None
-
None
Description
MLlib/Vector only support foreachActive function and is short of map/update 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))
or we can use "toBreeze" and "fromBreeze" make transformation with breeze API.
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/foreachActive function. I think Vector should also has map/update.
Attachments
Issue Links
- is part of
-
SPARK-6442 MLlib Local Linear Algebra Package
- Resolved
- links to