Hello Sparkers,
I kept getting this error:
java.lang.ClassCastException: scala.Tuple2 cannot be cast to
org.apache.spark.mllib.regression.LabeledPoint
I have tried the following to convert v._1 to double:
Method 1:
(if(v._10) 1d else 0d)
Method 2:
def bool2Double(b:Boolean): Double
,
I kept getting this error:
java.lang.ClassCastException: scala.Tuple2 cannot be cast to
org.apache.spark.mllib.regression.LabeledPoint
I have tried the following to convert v._1 to double:
Method 1:
(if(v._10) 1d else 0d)
Method 2:
def bool2Double(b:Boolean): Double = {
if (b) 1.0