spark-instrumented-optimizer/python/pyspark/ml/param
Holden Karau 3b29004d24 [SPARK-7675][ML][PYSPARK] sparkml params type conversion
From JIRA:
Currently, PySpark wrappers for spark.ml Scala classes are brittle when accepting Param types. E.g., Normalizer's "p" param cannot be set to "2" (an integer); it must be set to "2.0" (a float). Fixing this is not trivial since there does not appear to be a natural place to insert the conversion before Python wrappers call Java's Params setter method.

A possible fix will be to include a method "_checkType" to PySpark's Param class which checks the type, prints an error if needed, and converts types when relevant (e.g., int to float, or scipy matrix to array). The Java wrapper method which copies params to Scala can call this method when available.

This fix instead checks the types at set time since I think failing sooner is better, but I can switch it around to check at copy time if that would be better. So far this only converts int to float and other conversions (like scipymatrix to array) are left for the future.

Author: Holden Karau <holden@us.ibm.com>

Closes #9581 from holdenk/SPARK-7675-PySpark-sparkml-Params-type-conversion.
2016-01-06 10:43:03 -08:00
..
__init__.py [SPARK-7675][ML][PYSPARK] sparkml params type conversion 2016-01-06 10:43:03 -08:00
_shared_params_code_gen.py [SPARK-7675][ML][PYSPARK] sparkml params type conversion 2016-01-06 10:43:03 -08:00
shared.py [SPARK-7675][ML][PYSPARK] sparkml params type conversion 2016-01-06 10:43:03 -08:00