How to map an RDD of case class to LabeledPoint(label, feature vector).

This is the RDD of case class Exam(x : Double, y: Double) :

Ds(1.0,6.0)

Ds(2.0,8.0)

Ds(3.0,10.0)

Ds(3.0,10.0)

ds(4.0,12.0)

Ds(5.0,14.0)

Tried doing this -

```
     val parsedData = aRDD.map(row =>
     new LabeledPoint(
     row._1,
     Vectors.dense(row._2))

```

Getting error "value \_1 is not a member of main.scala.spark.Q1Partb.Q1.Exam" at row.\_1 and row.\_2

and this -

```
          val parsedData = aRDD.map{line => 
          val Array(rawLabel, rawfeatures) = line.split(',')
          val features = rawfeatures) .split(' ').map(_.toDouble)
          LabeledPoint(rawLabel.toDouble, Vectors.dense(features))}

```

Getting error "recursive value x$4 needs type" for rawLabel and "value split is not a member of main.scala.spark.Q1Partb.Q1.ds" for line.split(',')