GitHub user huaxingao opened a pull request:
https://github.com/apache/spark/pull/20968
[SPARK-23828][ML][PYTHON]PySpark StringIndexerModel should have constructor
from labels
## What changes were proposed in this pull request?
The Scala StringIndexerModel has an alternate constructor that will create
the model from an array of label strings. Add the corresponding Python API:
model = StringIndexerModel.from_labels(["a", "b", "c"])
## How was this patch tested?
Add doctest and unit test.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/huaxingao/spark spark-23828
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20968.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 #20968
----
commit 021538e8300fb33dc7462c102c784c0ac20c120a
Author: Huaxin Gao <huaxing@...>
Date: 2018-04-03T17:40:23Z
[SPARK-23828][ML][PYTHON]PySpark StringIndexerModel should have constructor
from labels
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]