Re: scala Vector vs mllib Vector

2014-10-04 Thread Dean Wampler
Spark isolates each task, so I would use the MLlib vector. I didn't mention this, but it also integrates with Breeze, a Scala mathematics library that you might find useful. dean Dean Wampler, Ph.D. Author: Programming Scala, 2nd Edition (O'Reill

Re: scala Vector vs mllib Vector

2014-10-04 Thread ll
thanks dean. thanks for the answer with great clarity! i'm working on an algorithm that has a weight vector W(w0, w1, .., wN). the elements of this weight vector are adjusted/updated frequently - every iteration of the algorithm. how would you recommend to implement this vector? what is the

Re: scala Vector vs mllib Vector

2014-10-04 Thread Dean Wampler
Briefly, MLlib's Vector and the concrete subclasses DenseVector and SparkVector wrap Java arrays, which are mutable and maximize memory efficiency. To update one of these vectors, you mutate the elements of the underlying array. That's great for performance, but dangerous in multithreaded programs