Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16344#discussion_r93971681
--- 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 --
Why not a companion object for TweedieFamily though? that just seems easy
and more correct
---
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]