diff options
author | Holden Karau <holden@pigscanfly.ca> | 2015-10-07 17:50:35 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2015-10-07 17:50:35 -0700 |
commit | 3aff0866a8601b4daf760d6bf175f68d5a0c8912 (patch) | |
tree | 6f9085d991fb04be7d00fb8159692dfe75fbd30f /python/pyspark/ml/param/shared.py | |
parent | 1bc435ae3afb7a007b8a8ff00dcad4738a9ff055 (diff) | |
download | spark-3aff0866a8601b4daf760d6bf175f68d5a0c8912.tar.gz spark-3aff0866a8601b4daf760d6bf175f68d5a0c8912.tar.bz2 spark-3aff0866a8601b4daf760d6bf175f68d5a0c8912.zip |
[SPARK-9774] [ML] [PYSPARK] Add python api for ml regression isotonicregression
Add the Python API for isotonicregression.
Author: Holden Karau <holden@pigscanfly.ca>
Closes #8214 from holdenk/SPARK-9774-add-python-api-for-ml-regression-isotonicregression.
Diffstat (limited to 'python/pyspark/ml/param/shared.py')
-rw-r--r-- | python/pyspark/ml/param/shared.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/python/pyspark/ml/param/shared.py b/python/pyspark/ml/param/shared.py index af12181286..8c438bc74f 100644 --- a/python/pyspark/ml/param/shared.py +++ b/python/pyspark/ml/param/shared.py @@ -570,6 +570,33 @@ class HasThresholds(Params): return self.getOrDefault(self.thresholds) +class HasWeightCol(Params): + """ + Mixin for param weightCol: weight column name. If this is not set or empty, we treat all instance weights as 1.0.. + """ + + # a placeholder to make it appear in the generated doc + weightCol = Param(Params._dummy(), "weightCol", "weight column name. If this is not set or empty, we treat all instance weights as 1.0.") + + def __init__(self): + super(HasWeightCol, self).__init__() + #: param for weight column name. If this is not set or empty, we treat all instance weights as 1.0. + self.weightCol = Param(self, "weightCol", "weight column name. If this is not set or empty, we treat all instance weights as 1.0.") + + def setWeightCol(self, value): + """ + Sets the value of :py:attr:`weightCol`. + """ + self._paramMap[self.weightCol] = value + return self + + def getWeightCol(self): + """ + Gets the value of weightCol or its default value. + """ + return self.getOrDefault(self.weightCol) + + class DecisionTreeParams(Params): """ Mixin for Decision Tree parameters. |