srowen commented on a change in pull request #15622: [SPARK-18092][ML] Fix
column prediction type error
URL: https://github.com/apache/spark/pull/15622#discussion_r242002575
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala
##########
@@ -78,9 +78,11 @@ class BinaryClassificationEvaluator @Since("1.4.0")
(@Since("1.4.0") override va
// TODO: When dataset metadata has been implemented, check
rawPredictionCol vector length = 2.
val scoreAndLabels =
- dataset.select(col($(rawPredictionCol)),
col($(labelCol)).cast(DoubleType)).rdd.map {
+ dataset.select(col($(rawPredictionCol)),
col($(labelCol)).cast(DoubleType))
+ .rdd
+ .map {
case Row(rawPrediction: Vector, label: Double) => (rawPrediction(1),
label)
- case Row(rawPrediction: Double, label: Double) => (rawPrediction,
label)
+ case Row(rawPrediction: Float, label: Double) =>
(rawPrediction.toDouble, label)
Review comment:
Why this change? in line 76 it's checked that it's a Double.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]