You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2016/08/11 16:00:19 UTC

spark git commit: Revert "[SPARK-16831][PYTHON] Fixed bug in CrossValidator.avgMetrics"

Repository: spark
Updated Branches:
  refs/heads/branch-1.6 ace458f03 -> b3ecff640


Revert "[SPARK-16831][PYTHON] Fixed bug in CrossValidator.avgMetrics"

This reverts commit 92ee6fbf5d5096245d9f1a84cd3a8e66062dd945.


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

Branch: refs/heads/branch-1.6
Commit: b3ecff640f5ecaf07edcdc6f284644440f788201
Parents: ace458f
Author: Sean Owen <so...@cloudera.com>
Authored: Thu Aug 11 16:59:54 2016 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Thu Aug 11 16:59:54 2016 +0100

----------------------------------------------------------------------
 python/pyspark/ml/tuning.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/b3ecff64/python/pyspark/ml/tuning.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/tuning.py b/python/pyspark/ml/tuning.py
index 8f2cd62..705ee53 100644
--- a/python/pyspark/ml/tuning.py
+++ b/python/pyspark/ml/tuning.py
@@ -108,8 +108,6 @@ class CrossValidator(Estimator):
     >>> evaluator = BinaryClassificationEvaluator()
     >>> cv = CrossValidator(estimator=lr, estimatorParamMaps=grid, evaluator=evaluator)
     >>> cvModel = cv.fit(dataset)
-    >>> cvModel.avgMetrics[0]
-    0.5
     >>> evaluator.evaluate(cvModel.transform(dataset))
     0.8333...
 
@@ -241,7 +239,7 @@ class CrossValidator(Estimator):
                 model = est.fit(train, epm[j])
                 # TODO: duplicate evaluator to take extra params from input
                 metric = eva.evaluate(model.transform(validation, epm[j]))
-                metrics[j] += metric/nFolds
+                metrics[j] += metric
 
         if eva.isLargerBetter():
             bestIndex = np.argmax(metrics)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org