Repository: spark
Updated Branches:
  refs/heads/branch-1.4 fd87b2aec -> d49b72c23


[SPARK-7431] [ML] [PYTHON] Made CrossValidatorModel call parent init in PySpark

Fixes bug with PySpark cvModel not having UID
Also made small PySpark fixes: Evaluator should inherit from Params.  MockModel 
should inherit from Model.

CC: mengxr

Author: Joseph K. Bradley <[email protected]>

Closes #5968 from jkbradley/pyspark-cv-uid and squashes the following commits:

57f13cd [Joseph K. Bradley] Made CrossValidatorModel call parent init in PySpark

(cherry picked from commit 3038443e58b9320c56f7785d9e36d4f85a563e6b)
Signed-off-by: Joseph K. Bradley <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d49b72c2
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d49b72c2
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d49b72c2

Branch: refs/heads/branch-1.4
Commit: d49b72c23820de795b96fd2e6d3de8a61d77fdd0
Parents: fd87b2a
Author: Joseph K. Bradley <[email protected]>
Authored: Sun May 10 13:29:27 2015 -0700
Committer: Joseph K. Bradley <[email protected]>
Committed: Sun May 10 13:29:36 2015 -0700

----------------------------------------------------------------------
 python/pyspark/ml/pipeline.py | 2 +-
 python/pyspark/ml/tests.py    | 4 ++--
 python/pyspark/ml/tuning.py   | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d49b72c2/python/pyspark/ml/pipeline.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/pipeline.py b/python/pyspark/ml/pipeline.py
index c1b2077..fdbae06 100644
--- a/python/pyspark/ml/pipeline.py
+++ b/python/pyspark/ml/pipeline.py
@@ -179,7 +179,7 @@ class PipelineModel(Model):
         return dataset
 
 
-class Evaluator(object):
+class Evaluator(Params):
     """
     Base class for evaluators that compute metrics from predictions.
     """

http://git-wip-us.apache.org/repos/asf/spark/blob/d49b72c2/python/pyspark/ml/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/tests.py b/python/pyspark/ml/tests.py
index 3a42bcf..75bb5d7 100644
--- a/python/pyspark/ml/tests.py
+++ b/python/pyspark/ml/tests.py
@@ -34,7 +34,7 @@ from pyspark.tests import ReusedPySparkTestCase as 
PySparkTestCase
 from pyspark.sql import DataFrame
 from pyspark.ml.param import Param
 from pyspark.ml.param.shared import HasMaxIter, HasInputCol
-from pyspark.ml.pipeline import Transformer, Estimator, Pipeline
+from pyspark.ml.pipeline import Estimator, Model, Pipeline, Transformer
 
 
 class MockDataset(DataFrame):
@@ -77,7 +77,7 @@ class MockEstimator(Estimator):
         return model
 
 
-class MockModel(MockTransformer, Transformer):
+class MockModel(MockTransformer, Model):
 
     def __init__(self):
         super(MockModel, self).__init__()

http://git-wip-us.apache.org/repos/asf/spark/blob/d49b72c2/python/pyspark/ml/tuning.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/tuning.py b/python/pyspark/ml/tuning.py
index 28e3727..86f4dc7 100644
--- a/python/pyspark/ml/tuning.py
+++ b/python/pyspark/ml/tuning.py
@@ -236,6 +236,7 @@ class CrossValidatorModel(Model):
     """
 
     def __init__(self, bestModel):
+        super(CrossValidatorModel, self).__init__()
         #: best model from cross validation
         self.bestModel = bestModel
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to