Github user yanboliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/16344#discussion_r94773283
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
---
@@ -128,13 +152,14 @@ private[regression] trait
GeneralizedLinearRegressionBase extends PredictorParam
* Generalized linear model (Wikipedia)</a>)
* specified by giving a symbolic description of the linear
* predictor (link function) and a description of the error distribution
(family).
- * It supports "gaussian", "binomial", "poisson" and "gamma" as family.
+ * It supports "gaussian", "binomial", "poisson", "gamma" and "tweedie" as
family.
* Valid link functions for each family is listed below. The first link
function of each family
* is the default one.
* - "gaussian" : "identity", "log", "inverse"
* - "binomial" : "logit", "probit", "cloglog"
* - "poisson" : "log", "identity", "sqrt"
* - "gamma" : "inverse", "identity", "log"
+ * - "tweedie" : "log", "identity"
--- End diff --
The default link for tweedie family is identity in R and H2O, I think we
should keep consistent with them. See my comments at L193.
BTW, we can expose param ```linkPower```(```1.0 - variancePower``` as
default value) to support other link functions except for ```log``` and
```identity```. The link functions corresponding to "tweedie" family should be:
```
def link(mu: Double): Double = math.pow(mu, linkPower)
```
I think we should generate ```Link``` object according to the input value
of ```linkPower``` if the ```family``` was set with "tweedie", we can follow
the way of ```family``` to generate ```link``` object by defining a function
like:
```
private[regression] object Link {
def fromParams(params: GeneralizedLinearRegressionBase): Link = {
......
}
}
```
---
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]