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

    https://github.com/apache/spark/pull/6339#discussion_r35581919
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/feature/StringIndexerSuite.scala ---
    @@ -47,6 +47,11 @@ class StringIndexerSuite extends SparkFunSuite with 
MLlibTestSparkContext {
         // a -> 0, b -> 2, c -> 1
         val expected = Set((0, 0.0), (1, 2.0), (2, 1.0), (3, 0.0), (4, 0.0), 
(5, 1.0))
         assert(output === expected)
    +    // convert reverse our transform
    +    val reversed = indexer.invert().transform(transformed.select("id", 
"labelIndex"))
    +      .select("id", "label")
    +    assert(df.collect().map(r => (r.getInt(0), r.getString(1))).toSet ===
    --- End diff --
    
    It'd be nice to check more carefully by zipping the original label column 
with the newly created one, and checking for equality.


---
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