-
- Downloads
[SPARK-14104][PYSPARK][ML] All Python param setters should use the `_set` method
## What changes were proposed in this pull request? Param setters in python previously accessed the _paramMap directly to update values. The `_set` method now implements type checking, so it should be used to update all parameters. This PR eliminates all direct accesses to `_paramMap` besides the one in the `_set` method to ensure type checking happens. Additional changes: * [SPARK-13068](https://github.com/apache/spark/pull/11663) missed adding type converters in evaluation.py so those are done here * An incorrect `toBoolean` type converter was used for StringIndexer `handleInvalid` param in previous PR. This is fixed here. ## How was this patch tested? Existing unit tests verify that parameters are still set properly. No new functionality is actually added in this PR. Author: sethah <seth.hendrickson16@gmail.com> Closes #11939 from sethah/SPARK-14104.
Showing
- python/pyspark/ml/classification.py 10 additions, 12 deletionspython/pyspark/ml/classification.py
- python/pyspark/ml/clustering.py 5 additions, 5 deletionspython/pyspark/ml/clustering.py
- python/pyspark/ml/evaluation.py 10 additions, 7 deletionspython/pyspark/ml/evaluation.py
- python/pyspark/ml/feature.py 37 additions, 35 deletionspython/pyspark/ml/feature.py
- python/pyspark/ml/param/__init__.py 19 additions, 3 deletionspython/pyspark/ml/param/__init__.py
- python/pyspark/ml/param/_shared_params_code_gen.py 1 addition, 1 deletionpython/pyspark/ml/param/_shared_params_code_gen.py
- python/pyspark/ml/param/shared.py 1 addition, 1 deletionpython/pyspark/ml/param/shared.py
- python/pyspark/ml/pipeline.py 1 addition, 1 deletionpython/pyspark/ml/pipeline.py
- python/pyspark/ml/recommendation.py 11 additions, 11 deletionspython/pyspark/ml/recommendation.py
- python/pyspark/ml/regression.py 12 additions, 12 deletionspython/pyspark/ml/regression.py
- python/pyspark/ml/tuning.py 2 additions, 2 deletionspython/pyspark/ml/tuning.py
- python/pyspark/ml/wrapper.py 1 addition, 1 deletionpython/pyspark/ml/wrapper.py
Loading
Please register or sign in to comment