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/03/12 17:02:00 UTC

[GitHub] [spark] zero323 commented on a change in pull request #35766: [SPARK-37425][PYTHON] Inline type hints for python/pyspark/mllib/recommendation.py

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



##########
File path: python/pyspark/mllib/recommendation.py
##########
@@ -245,8 +249,15 @@ def _prepare(cls, ratings):
 
     @classmethod
     def train(
-        cls, ratings, rank, iterations=5, lambda_=0.01, blocks=-1, nonnegative=False, seed=None
-    ):
+        cls,
+        ratings: Union[RDD[Rating], RDD[Tuple[int, int, float]]],
+        rank: int,
+        iterations: int = 5,
+        lambda_: float = 0.01,
+        blocks: int = -1,
+        nonnegative: bool = False,
+        seed: Optional[int] = None,
+    ) -> "MatrixFactorizationModel":

Review comment:
       There should be no need for quotes here.

##########
File path: python/pyspark/mllib/recommendation.py
##########
@@ -296,15 +307,15 @@ def train(
     @classmethod
     def trainImplicit(
         cls,
-        ratings,
-        rank,
-        iterations=5,
-        lambda_=0.01,
-        blocks=-1,
-        alpha=0.01,
-        nonnegative=False,
-        seed=None,
-    ):
+        ratings: Union[RDD[Rating], RDD[Tuple[int, int, float]]],
+        rank: int,
+        iterations: int = 5,
+        lambda_: float = 0.01,
+        blocks: int = 1,
+        alpha: float = 0.01,
+        nonnegative: bool = False,
+        seed: Optional[int] = None,
+    ) -> "MatrixFactorizationModel":

Review comment:
       Ditto./




-- 
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