You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mengxr <gi...@git.apache.org> on 2015/11/03 01:31:07 UTC

[GitHub] spark pull request: [SPARK-11349] [ML] Support transform string la...

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

    https://github.com/apache/spark/pull/9302#discussion_r43703873
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala ---
    @@ -200,6 +200,13 @@ class RFormulaModel private[feature](
           dataset.schema(labelName).dataType match {
             case _: NumericType | BooleanType =>
               dataset.withColumn($(labelCol), dataset(labelName).cast(DoubleType))
    +        case _: StringType => {
    +          val indexer = new StringIndexer()
    --- End diff --
    
    This should not happen inside `transform`. we cannot afford one `fit` call per `transform`. We should inside the label indexer into the `RFormula.fit`instead of `RFormulaModel.transform`.


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