Github user MechCoder commented on a diff in the pull request:
https://github.com/apache/spark/pull/6821#discussion_r32891085
--- Diff: python/pyspark/mllib/feature.py ---
@@ -447,6 +454,17 @@ class Word2Vec(object):
>>> syms = model.findSynonyms(vec, 2)
>>> [s[0] for s in syms]
[u'b', u'c']
+
+ >>> import os, tempfile
+ >>> path = tempfile.mkdtemp()
+ >>> model.save(sc, path)
+ >>> sameModel = Word2VecModel.load(sc, path)
+ >>> model.transform("a") == sameModel.transform("a")
--- End diff --
It has been advised by @mengxr to keep doctests and testing for correctness
separately. (https://github.com/apache/spark/pull/6499#discussion_r32784734)
It might be better to just write sameModel.transform("a") and write a small
test to test model and sameModel give same results using `getVectors` maybe?
---
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]