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

    https://github.com/apache/spark/pull/13129#discussion_r63677021
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
 ---
    @@ -239,10 +239,7 @@ class GeneralizedLinearRegression @Since("2.0.0") 
(@Since("2.0.0") override val
         }
         val familyAndLink = new FamilyAndLink(familyObj, linkObj)
     
    -    val numFeatures = dataset.select(col($(featuresCol))).limit(1).rdd
    -      .map { case Row(features: Vector) =>
    -        features.size
    -      }.first()
    +    val numFeatures = 
dataset.select(col($(featuresCol))).first().getAs[Vector](0).size
    --- End diff --
    
    Ah right, we would need to add an implicit encoder `implicit def encoder: 
Encoder[Vector] = ExpressionEncoder()`, e.g. see here 
https://github.com/apache/spark/pull/12718#issuecomment-215332276.
    
    However, let's leave that change for #12718


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