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

    https://github.com/apache/spark/pull/16729#discussion_r98341050
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/r/GeneralizedLinearRegressionWrapper.scala
 ---
    @@ -81,15 +83,20 @@ private[r] object GeneralizedLinearRegressionWrapper
           .attributes.get
         val features = featureAttrs.map(_.name.get)
         // assemble and fit the pipeline
    -    val glr = new GeneralizedLinearRegression()
    +    var glr = new GeneralizedLinearRegression()
           .setFamily(family)
    -      .setLink(link)
           .setFitIntercept(rFormula.hasIntercept)
           .setTol(tol)
           .setMaxIter(maxIter)
           .setWeightCol(weightCol)
           .setRegParam(regParam)
           .setFeaturesCol(rFormula.getFeaturesCol)
    +    // set variancePower and linkPower if family is tweedie; otherwise, 
set link function
    +    if (family.toLowerCase == "tweedie") {
    +      glr = glr.setVariancePower(variancePower).setLinkPower(linkPower)
    --- End diff --
    
    do we need to assign `glr =` here? generally the setter method will update 
the instance


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