Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/17622#discussion_r112905614
--- Diff: python/pyspark/ml/recommendation.py ---
@@ -384,6 +392,28 @@ def itemFactors(self):
"""
return self._call_java("itemFactors")
+ @since("2.2.0")
+ def recommendForAllUsers(self, numItems):
+ """
+ Returns top `numItems` items recommended for each user, for all
users.
+
+ :param numItems: max number of recommendations for each user
+ :return: a DataFrame of (userCol, recommendations), where
recommendations are
+ stored as an array of (itemCol, rating) Rows.
+ """
+ return self._call_java("recommendForAllUsers", numItems)
+
+ @since("2.2.0")
+ def recommendForAllItems(self, numUsers):
+ """
+ Returns top `numUsers` users recommended for each item, for all
items.
+
+ :param numItems: max number of recommendations for each item
--- End diff --
Thanks!
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]