spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From attilapiros <...@git.apache.org>
Subject [GitHub] spark pull request #20686: [SPARK-22915][MLlib] Streaming tests for spark.ml...
Date Fri, 02 Mar 2018 04:57:58 GMT
Github user attilapiros commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20686#discussion_r171765261
  
    --- Diff: mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderEstimatorSuite.scala
---
    @@ -103,11 +96,12 @@ class OneHotEncoderEstimatorSuite
           .setInputCols(Array("size"))
           .setOutputCols(Array("encoded"))
         val model = encoder.fit(df)
    -    val output = model.transform(df)
    -    val group = AttributeGroup.fromStructField(output.schema("encoded"))
    -    assert(group.size === 2)
    -    assert(group.getAttr(0) === BinaryAttribute.defaultAttr.withName("small").withIndex(0))
    -    assert(group.getAttr(1) === BinaryAttribute.defaultAttr.withName("medium").withIndex(1))
    +    testTransformerByGlobalCheckFunc[(Double)](df, model, "encoded") { rows =>
    +        val group = AttributeGroup.fromStructField(rows.head.schema("encoded"))
    +        assert(group.size === 2)
    +        assert(group.getAttr(0) === BinaryAttribute.defaultAttr.withName("small").withIndex(0))
    +        assert(group.getAttr(1) === BinaryAttribute.defaultAttr.withName("medium").withIndex(1))
    +    }
    --- End diff --
    
    Thanks.


---

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


Mime
View raw message