diff options
Diffstat (limited to 'python/pyspark/ml/param')
-rw-r--r-- | python/pyspark/ml/param/_shared_params_code_gen.py | 4 | ||||
-rw-r--r-- | python/pyspark/ml/param/shared.py | 24 |
2 files changed, 27 insertions, 1 deletions
diff --git a/python/pyspark/ml/param/_shared_params_code_gen.py b/python/pyspark/ml/param/_shared_params_code_gen.py index 715fa9e9f8..a7615c43be 100644 --- a/python/pyspark/ml/param/_shared_params_code_gen.py +++ b/python/pyspark/ml/param/_shared_params_code_gen.py @@ -146,7 +146,9 @@ if __name__ == "__main__": ("weightCol", "weight column name. If this is not set or empty, we treat " + "all instance weights as 1.0.", None, "TypeConverters.toString"), ("solver", "the solver algorithm for optimization. If this is not set or empty, " + - "default value is 'auto'.", "'auto'", "TypeConverters.toString")] + "default value is 'auto'.", "'auto'", "TypeConverters.toString"), + ("varianceCol", "column name for the biased sample variance of prediction.", + None, "TypeConverters.toString")] code = [] for name, doc, defaultValueStr, typeConverter in shared: diff --git a/python/pyspark/ml/param/shared.py b/python/pyspark/ml/param/shared.py index d79d55e463..c9e975525c 100644 --- a/python/pyspark/ml/param/shared.py +++ b/python/pyspark/ml/param/shared.py @@ -559,6 +559,30 @@ class HasSolver(Params): return self.getOrDefault(self.solver) +class HasVarianceCol(Params): + """ + Mixin for param varianceCol: column name for the biased sample variance of prediction. + """ + + varianceCol = Param(Params._dummy(), "varianceCol", "column name for the biased sample variance of prediction.", typeConverter=TypeConverters.toString) + + def __init__(self): + super(HasVarianceCol, self).__init__() + + def setVarianceCol(self, value): + """ + Sets the value of :py:attr:`varianceCol`. + """ + self._set(varianceCol=value) + return self + + def getVarianceCol(self): + """ + Gets the value of varianceCol or its default value. + """ + return self.getOrDefault(self.varianceCol) + + class DecisionTreeParams(Params): """ Mixin for Decision Tree parameters. |