diff options
author | Xiangrui Meng <meng@databricks.com> | 2015-05-05 11:45:37 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-05-05 11:45:37 -0700 |
commit | ee374e89cd1f08730fed9d50b742627d5b19d241 (patch) | |
tree | 9912c353fe5e563bbf7ced6dc0e0c20f20272d5d /python/pyspark/ml/param/shared.py | |
parent | 18340d7be55a6834918956555bf820c96769aa52 (diff) | |
download | spark-ee374e89cd1f08730fed9d50b742627d5b19d241.tar.gz spark-ee374e89cd1f08730fed9d50b742627d5b19d241.tar.bz2 spark-ee374e89cd1f08730fed9d50b742627d5b19d241.zip |
[SPARK-7333] [MLLIB] Add BinaryClassificationEvaluator to PySpark
This PR adds `BinaryClassificationEvaluator` to Python ML Pipelines API, which is a simple wrapper of the Scala implementation. oefirouz
Author: Xiangrui Meng <meng@databricks.com>
Closes #5885 from mengxr/SPARK-7333 and squashes the following commits:
25d7451 [Xiangrui Meng] fix tests in python 3
babdde7 [Xiangrui Meng] fix doc
cb51e6a [Xiangrui Meng] add BinaryClassificationEvaluator in PySpark
Diffstat (limited to 'python/pyspark/ml/param/shared.py')
-rw-r--r-- | python/pyspark/ml/param/shared.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/python/pyspark/ml/param/shared.py b/python/pyspark/ml/param/shared.py index 13b6749998..4f243844f8 100644 --- a/python/pyspark/ml/param/shared.py +++ b/python/pyspark/ml/param/shared.py @@ -165,6 +165,35 @@ class HasPredictionCol(Params): return self.getOrDefault(self.predictionCol) +class HasRawPredictionCol(Params): + """ + Mixin for param rawPredictionCol: raw prediction column name. + """ + + # a placeholder to make it appear in the generated doc + rawPredictionCol = Param(Params._dummy(), "rawPredictionCol", "raw prediction column name") + + def __init__(self): + super(HasRawPredictionCol, self).__init__() + #: param for raw prediction column name + self.rawPredictionCol = Param(self, "rawPredictionCol", "raw prediction column name") + if 'rawPrediction' is not None: + self._setDefault(rawPredictionCol='rawPrediction') + + def setRawPredictionCol(self, value): + """ + Sets the value of :py:attr:`rawPredictionCol`. + """ + self.paramMap[self.rawPredictionCol] = value + return self + + def getRawPredictionCol(self): + """ + Gets the value of rawPredictionCol or its default value. + """ + return self.getOrDefault(self.rawPredictionCol) + + class HasInputCol(Params): """ Mixin for param inputCol: input column name. |