-
-
Notifications
You must be signed in to change notification settings - Fork 261
Fix svd flip #595
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
Fix svd flip #595
Conversation
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.
Can you add a test that's failing on master? You may be able to construct a readonly array manually, and call svd_flip on that.
dask_ml/utils.py
Outdated
@@ -23,8 +23,37 @@ | |||
logger = logging.getLogger() | |||
|
|||
|
|||
def svd_flip_with_copy(u, v, u_based_decision=True): |
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.
Rather than duplicating the entire implementation, can you copy the inputs and set them to not be readonly?
Thank you, @TomAugspurger, for the reply. Could you instruct me how to construct a read only dask array? |
Dask Arrays don't really have a "readonly" concept. It'd be the underlying
NumPy array that's readonly.
…On Mon, Dec 30, 2019 at 7:50 AM Keisuke Fujii ***@***.***> wrote:
Thank you, @TomAugspurger <https://github.com/TomAugspurger>, for the
reply.
Could you instruct me how to construct a read only dask array?
I'll add a test for this case.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#595?email_source=notifications&email_token=AAKAOIS5GK4RFQF75KICQEDQ3H4DTA5CNFSM4J6YXYQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2K6JY#issuecomment-569683751>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIXJ2PJQAKWBCF7SRQLQ3H4DTANCNFSM4J6YXYQA>
.
|
Ok. Then probably I can do this. |
Added a test. |
I like that when @fujiisoup says "days" he actually means "hours" :) |
:) Thanks! These changes look perfect. The failure against scikit-learn master looks unrelated. |
cc @demaheim
This adds a workaround for #592
I'm not sure why but for some reason, the array becomes sometimes read-only and cannot do the inplace multiplication. Large PCA fails because of this issue.
It may not be a perfect fix but it works for large arrays > 1TB.
Please let me know if anyone has better idea to fix this.