Re: implementing the VectorAccumulatorParam

2014-06-09 Thread Sean Owen
(BCC dev@) The example is out of date with respect to current Vector class. The zeros() method is on "Vectors". There is not currently a += operation for Vector anymore. To be fair the example doesn't claim this illustrates use of the Spark Vector class but it did work with the now-deprecated Vec

Re: implementing the VectorAccumulatorParam

2014-06-09 Thread dataginjaninja
New error :-( scala> object VectorAccumulatorParam extends AccumulatorParam[Vector] { | def zero(initialValue: Vector): Vector = { | Vector.zeros(initialValue.size) | } | def addInPlace(v1: Vector, v2: Vector): Vector = { | v1 += v2 | } | } :14: e

Re: implementing the VectorAccumulatorParam

2014-06-09 Thread dataginjaninja
New error :-( scala> object VectorAccumulatorParam extends AccumulatorParam[Vector] { | def zero(initialValue: Vector): Vector = { | Vector.zeros(initialValue.size) | } | def addInPlace(v1: Vector, v2: Vector): Vector = { | v1 += v2 | } | } :12: e

Re: implementing the VectorAccumulatorParam

2014-06-09 Thread dataginjaninja
You are right. I was using the wrong vector class. Thanks. - Cheers, Stephanie -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/implementing-the-VectorAccumulatorParam-tp6973p6975.html Sent from the Apache Spark Developers List mailing list archive

Re: implementing the VectorAccumulatorParam

2014-06-09 Thread Sean Owen
(The user@ list might be a bit better but I can see why it might look like a dev@ question.) Did you import org.apache.spark.mllib.linalg.Vector ? I think you are picking up Scala's Vector class instead. On Mon, Jun 9, 2014 at 11:57 AM, dataginjaninja wrote: > The programming-guide >