[GitHub] spark pull request #13194: [SPARK-15402] [ML] [PySpark] PySpark ml.evaluatio...

2016-10-14 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/13194


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13194: [SPARK-15402] [ML] [PySpark] PySpark ml.evaluatio...

2016-10-12 Thread yanboliang
Github user yanboliang commented on a diff in the pull request:

https://github.com/apache/spark/pull/13194#discussion_r83032397
  
--- Diff: python/pyspark/ml/evaluation.py ---
@@ -21,7 +21,8 @@
 from pyspark.ml.wrapper import JavaParams
 from pyspark.ml.param import Param, Params, TypeConverters
 from pyspark.ml.param.shared import HasLabelCol, HasPredictionCol, 
HasRawPredictionCol
-from pyspark.ml.common import inherit_doc
+from pyspark.ml.util import JavaMLReadable, JavaMLWritable
+from pyspark.mllib.common import inherit_doc
--- End diff --

Oops, typo.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13194: [SPARK-15402] [ML] [PySpark] PySpark ml.evaluatio...

2016-10-12 Thread yanboliang
Github user yanboliang commented on a diff in the pull request:

https://github.com/apache/spark/pull/13194#discussion_r83032628
  
--- Diff: python/pyspark/ml/evaluation.py ---
@@ -311,19 +330,25 @@ def setParams(self, predictionCol="prediction", 
labelCol="label",
 
 if __name__ == "__main__":
 import doctest
+import tempfile
+import pyspark.ml.evaluation
 from pyspark.sql import SparkSession
-globs = globals().copy()
+globs = pyspark.ml.evaluation.__dict__.copy()
 # The small batch size here ensures that we see multiple batches,
 # even in these small test examples:
 spark = SparkSession.builder\
 .master("local[2]")\
 .appName("ml.evaluation tests")\
 .getOrCreate()
-sc = spark.sparkContext
-globs['sc'] = sc
 globs['spark'] = spark
-(failure_count, test_count) = doctest.testmod(
-globs=globs, optionflags=doctest.ELLIPSIS)
-spark.stop()
-if failure_count:
-exit(-1)
--- End diff --

Thanks for remind, added check ```failure_count```.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13194: [SPARK-15402] [ML] [PySpark] PySpark ml.evaluatio...

2016-10-11 Thread BryanCutler
Github user BryanCutler commented on a diff in the pull request:

https://github.com/apache/spark/pull/13194#discussion_r82877590
  
--- Diff: python/pyspark/ml/evaluation.py ---
@@ -311,19 +330,25 @@ def setParams(self, predictionCol="prediction", 
labelCol="label",
 
 if __name__ == "__main__":
 import doctest
+import tempfile
+import pyspark.ml.evaluation
 from pyspark.sql import SparkSession
-globs = globals().copy()
+globs = pyspark.ml.evaluation.__dict__.copy()
 # The small batch size here ensures that we see multiple batches,
 # even in these small test examples:
 spark = SparkSession.builder\
 .master("local[2]")\
 .appName("ml.evaluation tests")\
 .getOrCreate()
-sc = spark.sparkContext
-globs['sc'] = sc
 globs['spark'] = spark
-(failure_count, test_count) = doctest.testmod(
-globs=globs, optionflags=doctest.ELLIPSIS)
-spark.stop()
-if failure_count:
-exit(-1)
--- End diff --

should there still be an `exit(-1)` when failures?  If not then you can 
remove the returned variables from `doctest.testmod`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13194: [SPARK-15402] [ML] [PySpark] PySpark ml.evaluatio...

2016-10-11 Thread BryanCutler
Github user BryanCutler commented on a diff in the pull request:

https://github.com/apache/spark/pull/13194#discussion_r82849461
  
--- Diff: python/pyspark/ml/evaluation.py ---
@@ -21,7 +21,8 @@
 from pyspark.ml.wrapper import JavaParams
 from pyspark.ml.param import Param, Params, TypeConverters
 from pyspark.ml.param.shared import HasLabelCol, HasPredictionCol, 
HasRawPredictionCol
-from pyspark.ml.common import inherit_doc
+from pyspark.ml.util import JavaMLReadable, JavaMLWritable
+from pyspark.mllib.common import inherit_doc
--- End diff --

Just wondering why change to import from `mllib.common`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org