Skip to content
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

[WIP] Ridge fit_intercept with sparse X (issue #1389) #1560

Closed
wants to merge 3 commits into from

Conversation

vene
Copy link
Member

@vene vene commented Jan 10, 2013

At the moment partly ignores fit_intercept if X is sparse: It sets the intercept to the mean of y but doesn't take into account X, because _center_data doesn't center sparse matrices.

This PR fits a (penalized) intercept in the sparse case by using add_dummy_feature.

TODO:

  • Default values as suggested by @mblondel
  • Intercept weight
  • Figure out why this doesn't work in the wide X case: either what I'm doing is wrong, or the test isn't appropriate?

See #1389

@vene
Copy link
Member Author

vene commented Jan 10, 2013

Ping @amueller and @mblondel

@mblondel
Copy link
Member

What do you mean by "wide X"?

@mblondel
Copy link
Member

@vene When solver="auto" (the default), the solver used is not the same when X is dense and when X is sparse so you don't get the exact same results. Can you try to set the solver explicitly? (e.g. sparse_cg, which despite the name handle dense arrays too)

The unit tests are getting messy. It would be nice to break the tests into smaller units (not needed for this PR).

@vene
Copy link
Member Author

vene commented Jan 11, 2013

@mblondel: it doesn't fix it, and furthermore the results are the same, it's not that.

Does adding a column of ones change anything fundamental when the problem admits exact solutions?

@vene
Copy link
Member Author

vene commented Jul 25, 2013

@mblondel should I close this and let you take over? 🙇

@mblondel
Copy link
Member

I won't be able to tackle this issue this week unfortunately :-/
Feel free to finish it :-)

@MechCoder
Copy link
Member

@vene Can I try working on this, on a new branch, and send a separate PR if you do not mind?

@vene
Copy link
Member Author

vene commented Aug 11, 2014

Of course, please do!

On Mon, Aug 11, 2014 at 4:02 PM, Manoj Kumar notifications@github.com
wrote:

@vene https://github.com/vene Can I try working on this, on a new
branch, and send a separate PR if you do not mind?


Reply to this email directly or view it on GitHub
#1560 (comment)
.

@MechCoder
Copy link
Member

@vene @mblondel I do not really understand how we should center X (without breaking the sparsity or adding an extra column of ones for the intercept). Do we implement some sort of trick/hack after we get the coefficients?

@amueller
Copy link
Member

fixed by #13995 from what I can tell

@amueller amueller closed this Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants