You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/05 13:41:42 UTC

[GitHub] [spark] zero323 commented on a change in pull request #35403: [WIP][SPARK-37404][PYTHON][ML] Inline type hints for pyspark.ml.evaluation.py

zero323 commented on a change in pull request #35403:
URL: https://github.com/apache/spark/pull/35403#discussion_r800059103



##########
File path: python/pyspark/ml/evaluation.py
##########
@@ -130,16 +146,23 @@ def _evaluate(self, dataset):
             evaluation metric
         """
         self._transfer_params_to_java()
+        assert self._java_obj is not None
         return self._java_obj.evaluate(dataset._jdf)
 
-    def isLargerBetter(self):
+    def isLargerBetter(self) -> bool:
         self._transfer_params_to_java()
+        assert self._java_obj is not None
         return self._java_obj.isLargerBetter()
 
 
 @inherit_doc
 class BinaryClassificationEvaluator(
-    JavaEvaluator, HasLabelCol, HasRawPredictionCol, HasWeightCol, JavaMLReadable, JavaMLWritable
+    JavaEvaluator,
+    HasLabelCol,
+    HasRawPredictionCol,
+    HasWeightCol,
+    JavaMLReadable["BinaryClassificationEvaluator"],

Review comment:
       This is currently blocked by SPARK-37415 and SPARK-37416, as we need `MLReadable` types to be runtime generic (already tested if these three integrate together).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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