We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe2a10b commit bbdeaf3Copy full SHA for bbdeaf3
mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala
@@ -88,9 +88,9 @@ final class OneVsRestModel private[ml] (
88
89
// add an accumulator column to store predictions of all the models
90
val accColName = "mbc$acc" + UUID.randomUUID().toString
91
- val init: () => Map[Int, Double] = () => {Map()}
+ val init = udf { () => Map[Int, Double]() }
92
val mapType = MapType(IntegerType, DoubleType, valueContainsNull = false)
93
- val newDataset = dataset.withColumn(accColName, udf(init).apply())
+ val newDataset = dataset.withColumn(accColName, init())
94
95
// persist if underlying dataset is not persistent.
96
val handlePersistence = dataset.rdd.getStorageLevel == StorageLevel.NONE
0 commit comments