-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-6226][MLLIB] add save/load in PySpark's KMeansModel #5049
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
Conversation
Test build #28659 has started for PR 5049 at commit
|
Test build #28659 has finished for PR 5049 at commit
|
Test FAILed. |
Test build #28665 has started for PR 5049 at commit
|
Test build #28665 has finished for PR 5049 at commit
|
Test FAILed. |
test this please |
Test build #28672 has started for PR 5049 at commit
|
Test build #28672 has finished for PR 5049 at commit
|
Test PASSed. |
elif isinstance(obj, list) and (obj or isinstance(obj[0], JavaObject)): | ||
obj = ListConverter().convert(obj, sc._gateway._gateway_client) | ||
elif isinstance(obj, list): | ||
obj = ListConverter().convert([_py2java(sc, x) for x in obj], sc._gateway._gateway_client) |
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.
@mengxr Let me guess, when I encounter an Array[ndarray]
, this line of code will try to translate the ndarray
one by one. For each ndarray
, the else
statement will be triggered, PikleSerializer
will serialize the ndarray
, then the helper function in JVM will turn it back to Vector
.
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.
Correct. Except that we pass in vectors because we call _convert_to_vector
in KMeansModel.save
.
@mengxr Don't we need extra unittest? Does doctest well enough? |
Not necessary. doctests are examples+unittests. |
Merged into master. |
Use
_py2java
and_java2py
to convert Python model to/from Java model. @yinxusen