-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
LogisticRegression convert to float64 #8769
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
Comments
I can work on this |
Great! Handling float32 is not that hard: We need fused type : you can have
a look at cd_fast.pyx. Handling F ordered arrays is possible but requires
to change the way we access some arrays in place of the code where we use
explicit pointers.
…On Thu, Apr 20, 2017, 5:19 PM Joan Massich ***@***.***> wrote:
I can work on this
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8769 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD48Y4m29WJ2a8SIOcVzrOsd3E0-AHAsks5rx3dkgaJpZM4NC9c0>
.
|
Maybe not for L-BFGS: |
I will take care of introducing fused type in sag.pyx
…On Wed, Jun 7, 2017, 10:01 AM Olivier Grisel ***@***.***> wrote:
Reopened #8769 <#8769>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8769 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD48Y14MUFRBlUQSZU6S1OX2Ig8ebpdkks5sBli5gaJpZM4NC9c0>
.
|
@arthurmensch if you take care of fuse type in sag.pyx (see PR #9020) make sure to talk to @Henley13 |
saga and sag should indeed be addressed in the same PR. |
can we add isotonic regression to that list? I'll be happy to take it |
Sure :)
…On Sun, Jun 11, 2017, 08:57 Vlad Niculae ***@***.***> wrote:
can we add isotonic regression to that list? I'll be happy to take it
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8769 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGt-45MeYBb7lVbrJOzOs84Wkl7IUU5Vks5sC4_VgaJpZM4NC9c0>
.
|
@ogrisel suggested in #9033 to use if self.solver == 'lbfgs':
# scipy lbfgs does not support float32 yet:
# https://github.com/scipy/scipy/issues/4873
_dtype = np.float64
else:
# all other solvers work at both float precision levels
_dtype = [np.float64, np.float32] As well as adding a test to ensure that type of the predicted output remains consistent. i.e: assert_equal(clf_32.predict(X_32).dtype, X_32.dtype)
assert_equal(clf_64.predict(X_64).dtype, X_64.dtype) |
@ogrisel advised me that assert clf_32.predict(X_32).dtype == X_32.dtype
... is better as it leads to more informative error messages in |
at which point i assume we'll change all assert_equal?
…On 15 Jun 2017 1:59 am, "(Venkat) Raghav, Rajagopalan" < ***@***.***> wrote:
@ogrisel <https://github.com/ogrisel> advised me that
assert clf_32.predict(X_32).dtype == X_32.dtype...
is better as it leads to more informative error messages in pytests to
which we will be switching to soon.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8769 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz65b9bp9Vx25RKzR-B0A_td80OCfjks5sEANcgaJpZM4NC9c0>
.
|
Fixed by #13273 |
Looking at the code of LogisticRegression, I have just noticed that it converts automatically the data to float64. I would expect at least the SAG, SAGA, newton-cg and lbfgs solvers to be able to work with float32.
Also, in a similar line of thoughts, the code converts to C-ordered data. How useful / necessary is this for solvers others than liblinear.
I am asking these questions because it seems that we could reduce the memory footprint of LogisticRegression.
Ping @arthurmensch for the SAG part.
The text was updated successfully, but these errors were encountered: