spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From holdenk <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-9922] [ML] rename StringIndexerReverse ...
Date Thu, 13 Aug 2015 23:54:09 GMT
Github user holdenk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8152#discussion_r37038797
  
    --- Diff: mllib/src/test/scala/org/apache/spark/ml/feature/StringIndexerSuite.scala ---
    @@ -120,4 +108,36 @@ class StringIndexerSuite extends SparkFunSuite with MLlibTestSparkContext
{
         val df = sqlContext.range(0L, 10L)
         assert(indexerModel.transform(df).eq(df))
       }
    +
    +  test("IndexToString params") {
    +    val idxToStr = new IndexToString()
    +    ParamsSuite.checkParams(idxToStr)
    +  }
    +
    +  test("IndexToString.transform") {
    +    val labels = Array("a", "b", "c")
    +    val df0 = sqlContext.createDataFrame(Seq(
    +      (0, "a"), (1, "b"), (2, "c"), (0, "a")
    +    )).toDF("index", "expected")
    +
    +    val idxToStr0 = new IndexToString()
    +      .setInputCol("index")
    +      .setOutputCol("actual")
    +      .setLabels(labels)
    +    idxToStr0.transform(df0).select("actual", "expected").collect().foreach {
    +      case Row(actual, expected) =>
    +        assert(actual === expected)
    +    }
    +
    +    val attr = NominalAttribute.defaultAttr.withValues(labels)
    --- End diff --
    
    Ok


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

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


Mime
View raw message