Skip to content

Commit ebf4a6c

Browse files
committed
fix typos and comments
1 parent 0c32fca commit ebf4a6c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)