-
- Downloads
[SPARK-17161][PYSPARK][ML] Add PySpark-ML JavaWrapper convenience function to...
[SPARK-17161][PYSPARK][ML] Add PySpark-ML JavaWrapper convenience function to create Py4J JavaArrays ## What changes were proposed in this pull request? Adding convenience function to Python `JavaWrapper` so that it is easy to create a Py4J JavaArray that is compatible with current class constructors that have a Scala `Array` as input so that it is not necessary to have a Java/Python friendly constructor. The function takes a Java class as input that is used by Py4J to create the Java array of the given class. As an example, `OneVsRest` has been updated to use this and the alternate constructor is removed. ## How was this patch tested? Added unit tests for the new convenience function and updated `OneVsRest` doctests which use this to persist the model. Author: Bryan Cutler <cutlerb@gmail.com> Closes #14725 from BryanCutler/pyspark-new_java_array-CountVectorizer-SPARK-17161.
Showing
- mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala 0 additions, 5 deletions.../scala/org/apache/spark/ml/classification/OneVsRest.scala
- project/MimaExcludes.scala 4 additions, 1 deletionproject/MimaExcludes.scala
- python/pyspark/ml/classification.py 10 additions, 1 deletionpython/pyspark/ml/classification.py
- python/pyspark/ml/tests.py 38 additions, 2 deletionspython/pyspark/ml/tests.py
- python/pyspark/ml/wrapper.py 29 additions, 0 deletionspython/pyspark/ml/wrapper.py
Loading
Please register or sign in to comment