Github user MechCoder commented on a diff in the pull request:
https://github.com/apache/spark/pull/6856#discussion_r32618639
--- Diff: python/pyspark/mllib/clustering.py ---
@@ -96,6 +96,9 @@ def k(self):
def predict(self, x):
"""Find the cluster to which x belongs in this model."""
+ if isinstance(x, RDD):
+ return x.map(lambda v: self.predict(v))
--- End diff --
I caught the same thing here,
https://github.com/apache/spark/pull/6499/files#diff-21c55b407050d37f67a2919470e047ebR104
It can be written as just `x.map(self.predict)`
---
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]