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

    https://github.com/apache/spark/pull/11965#discussion_r57488992
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/RFormula.scala 
---
    @@ -400,14 +401,10 @@ private class VectorAttributeRewriter(
           val group = AttributeGroup.fromStructField(dataset.schema(vectorCol))
           val attrs = group.attributes.get.map { attr =>
             if (attr.name.isDefined) {
    -          val name = attr.name.get
    -          val replacement = prefixesToRewrite.filter { case (k, _) => 
name.startsWith(k) }
    -          if (replacement.nonEmpty) {
    -            val (k, v) = replacement.headOption.get
    -            attr.withName(v + name.stripPrefix(k))
    -          } else {
    -            attr
    +          val name = prefixesToRewrite.foldLeft(attr.name.get) { case 
(curName, (from, to)) =>
    --- End diff --
    
    This change was needed because of multiple prefixes being added (one for 
StringIndexer, and one for Interaction)


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