You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jk...@apache.org on 2015/05/10 22:29:32 UTC

spark git commit: [SPARK-7431] [ML] [PYTHON] Made CrossValidatorModel call parent init in PySpark

Repository: spark
Updated Branches:
  refs/heads/master 6bf9352fa -> 3038443e5


[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 <jo...@databricks.com>

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

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


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

Branch: refs/heads/master
Commit: 3038443e58b9320c56f7785d9e36d4f85a563e6b
Parents: 6bf9352
Author: Joseph K. Bradley <jo...@databricks.com>
Authored: Sun May 10 13:29:27 2015 -0700
Committer: Joseph K. Bradley <jo...@databricks.com>
Committed: Sun May 10 13:29:27 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/3038443e/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/3038443e/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/3038443e/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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org