Github user jkbradley commented on a diff in the pull request:
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Bucketizer.scala 
    @@ -73,15 +78,27 @@ final class Bucketizer @Since("1.4.0") (@Since("1.4.0") 
override val uid: String
       def setOutputCol(value: String): this.type = set(outputCol, value)
    +  /** @group setParam */
    +  @Since("2.1.0")
    +  def setHandleInvalid(value: String): this.type = set(handleInvalid, 
    +  setDefault(handleInvalid, "error")
       override def transform(dataset: Dataset[_]): DataFrame = {
    -    val bucketizer = udf { feature: Double =>
    -      Bucketizer.binarySearchForBuckets($(splits), feature)
    +    val bucketizer: UserDefinedFunction = udf { (feature: Double, flag: 
String) =>
    --- End diff --
    Also, at this point, you already know the value for flag, so you can just 
use it here, rather than making the UDF take an extra argument.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to