Github user yanboliang commented on the issue:

    https://github.com/apache/spark/pull/16344
  
    @actuaryzhang I totally agree that other link functions are rarely used for 
```tweedie``` family, but it should be supported correctly for all possible 
input. I list the reasons why we should expose ```linkPower``` param:
    *
    ```
    val trainer = new 
GeneralizedLinearRegression().setFamily("tweedie").setVariancePower(1.5)
    ```
    should produce the same output compared with
    ```
    glm(formula = "b ~ .", family = tweedie(var.power=1.5), data = df)
    ```
    unfortunately they are different in the current implementation, since the 
default link function for ```tweedie``` family with ```variancePower=1.5``` is 
```log``` in your code, which is incorrect, it should be ```mu^-0.5```.
    * I think the driving force of this PR is to support other distributions 
and links except the existing ones. If users want to use Gaussian, Poisson and 
Gamma families, they are likely to specify corresponding names directly rather 
than using ```tweedie``` family with ```variancePower = 0, 1, 2```. So if users 
specify family with ```tweedie```, they are likely to use other distributions 
and link functions which we should support correctly.
    * To your second point, if we allow an additional ```linkPower``` 
parameter, we can add documents to ```link``` to clarify it only applicable 
when family is not ```tweddie```. If family was set as ```tweddie```, we use 
```linkPower``` to choose the link function.
    
    Please feel free to let me know your thoughts, 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 [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