Status: In Progress
Affects Version/s: None
Fix Version/s: None
MLlib/Vector only support foreachActive function and is short of map/update which is inconvenience for some Vector operations.
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.