GitHub user actuaryzhang opened a pull request:
https://github.com/apache/spark/pull/16675
[SPARK-19155][ML] make getFamily case insensitive
## What changes were proposed in this pull request?
This is a supplement to PR #16516 which did not make the value from
`getFamily` case insensitive. This affects the calculation of `dispersion` and
`pValue` since the value of family is checked there: ` model.getFamily ==
Binomial.name || model.getFamily == Poisson.name) `. Current tests of
poisson/binomial glm with weight fail when specifying 'Poisson' or 'Binomial'.
A simple fix is to is to convert the value of `getFamily` to lower case:
```
def getFamily: String = $(family).toLowerCase
```
## How was this patch tested?
Update existing tests for 'Poisson' and 'Binomial'.
@yanboliang @felixcheung @imatiach-msft
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/actuaryzhang/spark family
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16675.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16675
----
commit d33e2f135ae62df20337e2752753bcda2756a73d
Author: actuaryzhang <[email protected]>
Date: 2017-01-23T02:59:12Z
make getFamily case insensitive
----
---
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]