-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-7104][MLlib] Support model save/load in Python's Word2Vec #6821
Conversation
Test build #34911 has finished for PR 6821 at commit
|
Test build #34915 has finished for PR 6821 at commit
|
@jkbradley Could you review it when you have time? Thanks! |
>>> path = tempfile.mkdtemp() | ||
>>> model.save(sc, path) | ||
>>> sameModel = Word2VecModel.load(sc, path) | ||
>>> model.transform("a") == sameModel.transform("a") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been advised by @mengxr to keep doctests and testing for correctness separately. (#6499 (comment))
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant was this test is not for correctness. I wanted to check whether a saved model works or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but I think it would be better to just write
sameModel.transform(a)
separately and the output.
However, I have no objections either !
will make a pass! test this please |
Looks good except for the pending comments |
Test build #35587 has finished for PR 6821 at commit
|
Jenkins, test this please. |
Test build #35610 has finished for PR 6821 at commit
|
@@ -27,6 +27,7 @@ import scala.language.existentials | |||
import scala.reflect.ClassTag | |||
|
|||
import net.razorvine.pickle._ | |||
import org.apache.spark.SparkContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
organize imports
@yu-iskw The only pending comments I see are the one I just made (organize imports) + using rmtree in the doctest. After those, this should be ready. |
Test build #36381 has finished for PR 6821 at commit
|
LGTM merging with master |
@jkbradley Thank you for merging it! |
No description provided.