GitHub user VinceShieh opened a pull request:
https://github.com/apache/spark/pull/14858
[SPARK-17219][ML] Add NaN value handling in Bucketizer
## What changes were proposed in this pull request?
This PR fixes an issue when a cutpoints vector containing NaN is sent to
Bucketizer.
Sometimes, null value might also be useful to users, so in these cases,
Bucketizer should
reserve one extra bucket for NaN values, instead of throwing an illegal
exception.
Before:
```
Bucketizer.transform on NaN value threw an illegal exception.
```
After:
```
NaN values will be grouped in an extra bucket.
```
## How was this patch tested?
New test cases added in `BucketizerSuite`.
Signed-off-by: VinceShieh <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/VinceShieh/spark spark-17219
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14858.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 #14858
----
commit bfb5b333d0a4e4a9d05a25cc0d47a5cdbd496965
Author: VinceShieh <[email protected]>
Date: 2016-08-26T13:02:31Z
[SPARK-17219][ML] Add NaN splits handling in Bucketizer
This PR fixes an issue when a cutpoints vector containing NaN is sent to
Bucketizer.
Sometimes, null value might also be useful to users, so in these cases,
Bucketizer should
reserve one extra bucket for NaN values, instead of throwing an illegal
exception.
Two unit tests added in BucketizerSuite
Signed-off-by: VinceShieh <[email protected]>
----
---
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]