File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
mllib/src/main/scala/org/apache/spark/ml/classification Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -215,8 +215,9 @@ final class OneVsRestModel private[ml] (
215215 }
216216
217217 // output the index of the classifier with highest confidence as prediction
218- val labelUDF = udf { (predictions : Vector ) => predictions .argmax.toDouble }
218+ val labelUDF = udf { (rawpredictions : Vector ) => rawpredictions .argmax.toDouble }
219219
220+ // output confidence as raw prediction, label and label metadata as prediction
220221 aggregatedDataset
221222 .withColumn(getRawPredictionCol, rawPredictionUDF(col(accColName)))
222223 .withColumn(getPredictionCol, labelUDF(col(getRawPredictionCol)), labelMetadata)
@@ -227,7 +228,7 @@ final class OneVsRestModel private[ml] (
227228 val labelUDF = udf { (predictions : Map [Int , Double ]) =>
228229 predictions.maxBy(_._2)._1.toDouble
229230 }
230- // output confidence as rwa prediction, label and label metadata as prediction
231+ // output label and label metadata as prediction
231232 aggregatedDataset
232233 .withColumn(getPredictionCol, labelUDF(col(accColName)), labelMetadata)
233234 .drop(accColName)
You can’t perform that action at this time.
0 commit comments