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

    https://github.com/apache/spark/pull/17840#discussion_r114773677
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/feature/BucketizerSuite.scala ---
    @@ -162,6 +165,28 @@ class BucketizerSuite extends SparkFunSuite with 
MLlibTestSparkContext with Defa
           .setSplits(Array(0.1, 0.8, 0.9))
         testDefaultReadWrite(t)
       }
    +
    +  test("Bucket non-double numeric features") {
    +    val splits = Array(-3.0, 0.0, 3.0)
    +    val data = Array(-2.0, -1.0, 0.0, 1.0, 2.0)
    +    val expectedBuckets = Array(0.0, 0.0, 1.0, 1.0, 1.0)
    +    val dataFrame: DataFrame = 
data.zip(expectedBuckets).toSeq.toDF("feature", "expected")
    +
    +    val bucketizer: Bucketizer = new Bucketizer()
    +      .setInputCol("feature")
    +      .setOutputCol("result")
    +      .setSplits(splits)
    +
    +    val types = Seq(ShortType, IntegerType, LongType, FloatType)
    --- End diff --
    
    Other tests for supporting numeric types have included `DecimalType` - 
often `DecimalType(10, 0)`, as well as `ByteType`. See the various Estimator 
tests which use `MLTestingUtils.genClassifDFWithNumericLabelCol` and 
`MLTestingUtils.genRegressionDFWithNumericLabelCol`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to