GitHub user wangmiao1981 opened a pull request:
https://github.com/apache/spark/pull/18496
[SparkR][SPARK-20307]:SparkR: pass on setHandleInvalid to spark.mllib
functions that use StringIndexer
## What changes were proposed in this pull request?
For randomForest classifier, if test data contains unseen labels, it will
throw an error. The StringIndexer already has the handleInvalid logic. The
patch add a new method to set the underlying StringIndexer handleInvalid logic.
This patch should also apply to other classifiers. This PR focuses on the
main logic and randomForest classifier. I will do follow-up PR for other
classifiers.
## How was this patch tested?
Add a new unit test based on the error case in the JIRA.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wangmiao1981/spark handle
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18496.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 #18496
----
commit a2cdf511f6ad346efcb81d51f3b805a34063fa0f
Author: wangmiao1981 <[email protected]>
Date: 2017-07-01T04:00:27Z
handle unseen labels
----
---
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]