Github user VinceShieh commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14858#discussion_r76738479
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Bucketizer.scala 
---
    @@ -106,18 +106,19 @@ final class Bucketizer @Since("1.4.0") 
(@Since("1.4.0") override val uid: String
     @Since("1.6.0")
     object Bucketizer extends DefaultParamsReadable[Bucketizer] {
     
    -  /** We require splits to be of length >= 3 and to be in strictly 
increasing order. */
    +  /** We require splits to be of length >= 3 and to be in strictly 
increasing order.
    +    * No NaN split should be accepted. */
       private[feature] def checkSplits(splits: Array[Double]): Boolean = {
         if (splits.length < 3) {
           false
         } else {
           var i = 0
           val n = splits.length - 1
           while (i < n) {
    -        if (splits(i) >= splits(i + 1)) return false
    +        if (splits(i) >= splits(i + 1) || splits(i).isNaN) return false
    --- End diff --
    
    add a safe checker for NaN split here


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to