Github user imatiach-msft commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16699#discussion_r98018075
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
 ---
    @@ -753,14 +794,15 @@ class GeneralizedLinearRegressionModel private[ml] (
       }
     
       override protected def transformImpl(dataset: Dataset[_]): DataFrame = {
    -    val predictUDF = udf { (features: Vector) => predict(features) }
    -    val predictLinkUDF = udf { (features: Vector) => predictLink(features) 
}
    +    val predictUDF = udf { (features: Vector, offset: Double) => 
predict(features, offset) }
    +    val predictLinkUDF = udf { (features: Vector, offset: Double) => 
predictLink(features, offset) }
    +    val off = if (!isSet(offsetCol) || $(offsetCol).isEmpty) lit(0.0) else 
col($(offsetCol))
    --- End diff --
    
    also, as I mentioned above, if family = Gaussian and link = Identity we 
shouldn't be passing any offset, but then the user shouldn't be setting an 
offset column probably - so either adding that to the validation logic or to 
the code here or to the predict function you call below would fix this unusual 
case; I think this seems like a validation issue and probably should be added 
to the validation method.


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

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

Reply via email to