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