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

    https://github.com/apache/spark/pull/16344#discussion_r93672741
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
 ---
    @@ -303,20 +337,24 @@ object GeneralizedLinearRegression extends 
DefaultParamsReadable[GeneralizedLine
     
       /** Set of family and link pairs that GeneralizedLinearRegression 
supports. */
       private[regression] lazy val supportedFamilyAndLinkPairs = Set(
    -    Gaussian -> Identity, Gaussian -> Log, Gaussian -> Inverse,
    -    Binomial -> Logit, Binomial -> Probit, Binomial -> CLogLog,
    -    Poisson -> Log, Poisson -> Identity, Poisson -> Sqrt,
    -    Gamma -> Inverse, Gamma -> Identity, Gamma -> Log
    +    "gaussian" -> Identity, "gaussian" -> Log, "gaussian" -> Inverse,
    +    "binomial" -> Logit, "binomial" -> Probit, "binomial" -> CLogLog,
    +    "poisson" -> Log, "poisson" -> Identity, "poisson" -> Sqrt,
    +    "gamma" -> Inverse, "gamma" -> Identity, "gamma" -> Log,
    +    "tweedie" -> Identity, "tweedie" -> Log
       )
     
       /** Set of family names that GeneralizedLinearRegression supports. */
    -  private[regression] lazy val supportedFamilyNames = 
supportedFamilyAndLinkPairs.map(_._1.name)
    +  private[regression] lazy val supportedFamilyNames = 
supportedFamilyAndLinkPairs.map(_._1)
     
       /** Set of link names that GeneralizedLinearRegression supports. */
       private[regression] lazy val supportedLinkNames = 
supportedFamilyAndLinkPairs.map(_._2.name)
     
       private[regression] val epsilon: Double = 1E-16
     
    +  /** Constant used in initialization and deviance to avoid numerical 
issues. */
    +  private[regression] val delta: Double = 0.1
    --- End diff --
    
    They are already in the `GeneralizedLinearRegression` object, aren't they? 
Or do you mean creating a new object say `Constant` that stores these two 
constants, and using them like `Constant.delta`? 
    
    Since `delta` is only used in the `TweedieFamily` class, I can also move it 
there. Let me know what is best. Thanks.


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