The Vector class is defined to work on doubles right now. You’d have to write 
your own version for floats.

Matei

On Feb 17, 2014, at 11:58 AM, agg <[email protected]> wrote:

> Hi,
> 
> I would like to run the spark example with floats instead of doubles.  When
> I change this:
> 
>  def parseVector(line: String): Vector = {
>    return new Vector(line.split(',').map(_.toDouble))
>  }
> 
> to:
> 
>  def parseVector(line: String): Vector = {
>    return new Vector(line.split(',').map(_.*toFloat*))
>  }
> 
> I get an error, saying it is expecting a double.  Any thoughts?
> 
> Thanks!
> 
> 
> 
> --
> View this message in context: 
> http://apache-spark-user-list.1001560.n3.nabble.com/Kmeans-example-with-floats-tp1640.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.

Reply via email to