GitHub user imatiach-msft opened a pull request:
https://github.com/apache/spark/pull/16377
[SPARK-18036][ML][MLLIB] Fixing decision trees handling edge cases
## What changes were proposed in this pull request?
Decision trees/GBT/RF do not handle edge cases such as constant features or
empty features.
In the case of constant features we choose any arbitrary split instead of
failing with a cryptic error message.
In the case of empty features we fail with a better error message stating:
DecisionTree requires number of features > 0, but was given an empty
features vector
Instead of the cryptic error message:
java.lang.UnsupportedOperationException: empty.max
## How was this patch tested?
Unit tests are added in the patch for:
DecisionTreeRegressor
GBTRegressor
Random Forest Regressor
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/imatiach-msft/spark ilmat/fix-decision-tree
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16377.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 #16377
----
commit 4cadbb0403b2d098fa91c97e23d92731d381361d
Author: Ilya Matiach <[email protected]>
Date: 2016-12-21T22:25:19Z
[SPARK-18036][ML][MLLIB] Fixing decision trees handling edge cases
----
---
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]