Github user actuaryzhang commented on the issue:
https://github.com/apache/spark/pull/16729
@felixcheung OK, new implementation of # 3. Now works in two ways:
1. `family = "tweedie"` + `variancePower` + `linkPower`
2. When `statmod` is available, `tweedie()`
Please take another look. Thanks.
```
# 1. Use variancePower and linkPower directly
> model <- spark.glm(training, Sepal_Width ~ Sepal_Length + Species,
+ family = "tweedie", variancePower = 1.2, linkPower =
0.0)
> summary(model)$coefficients
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6455411 0.07672839 8.413327 3.330669e-14
Sepal_Length 0.1169143 0.01508433 7.750714 1.425526e-12
Species_versicolor -0.3224752 0.02345653 -13.747781 0.000000e+00
Species_virginica -0.3282173 0.03042303 -10.788450 0.000000e+00
# 2. Use statmod
> library(statmod)
> model <- spark.glm(training, Sepal_Width ~ Sepal_Length + Species, family
= tweedie(1.2, 0))
> summary(model)$coefficients
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.6455411 0.07672839 8.413327 3.330669e-14
Sepal_Length 0.1169143 0.01508433 7.750714 1.425526e-12
Species_versicolor -0.3224752 0.02345653 -13.747781 0.000000e+00
Species_virginica -0.3282173 0.03042303 -10.788450 0.000000e+00
```
---
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]