2
我得到以下發現:org.apache.spark.sql.Dataset [(雙人間,雙人間)]要求:org.apache.spark.rdd.RDD [(雙人間,雙人間)]
found : org.apache.spark.sql.Dataset[(Double, Double)]
required: org.apache.spark.rdd.RDD[(Double, Double)]
val testMetrics = new BinaryClassificationMetrics(testScoreAndLabel)
錯誤
在下面的代碼:
val testScoreAndLabel = testResults.
select("Label","ModelProbability").
map{ case Row(l:Double,p:Vector) => (p(1),l) }
val testMetrics = new BinaryClassificationMetrics(testScoreAndLabel)
從錯誤似乎testScoreAndLabel
是sql.Dataset
類型,但BinaryClassificationMetrics
期望一個RDD
。
如何將sql.Dataset
轉換爲RDD
?