从scala上的Spark RDD对象构建RDD LabeledPoint

时间:2016-05-31 12:58:33

标签: scala apache-spark rdd spark-dataframe

我想从bar :: Bool -> Float bar b = ... main = print (bar (f "testing)) -- Bool is chosen 对象构建RDD[LabeledPoint],RDD对象如下:

RDD

我想使用 +-------------------+---------+--------------+--------+-------+ | date_time|site_name|posa_continent|year |label | +-------------------+---------+--------------+--------+-------+ |2014-08-11 07:46:59| 2| 3|2014 |1 | |2014-08-11 08:22:12| 2| 3|2014 |2 | |2015-08-11 08:24:33| 2| 3|2015 |1 | |2016-08-09 18:05:16| 2| 3|2016 |3 | |2011-08-09 18:08:18| 2| 3|2011 |2 | |2009-08-09 18:13:12| 2| 3|2009 |1 | |2014-07-16 09:42:23| 2| 3|2014 |1 | +-------------------+---------+--------------+--------+-------+ attribut构建RDD[LabeledPoint]以应用KNN机器学习算法。我使用Spark Scala API。

1 个答案:

答案 0 :(得分:0)

在RDD上尝试rake assets:precompile 功能:

map