Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG+2]: Fix Ridge GCV with centered data #6178

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

Merged
merged 11 commits into from
Oct 5, 2016

Conversation

bthirion
Copy link
Member

Addresses #1807
The following code solves it correctly as far as I can see. I've tried to deal cleanly with sample weight and sparse matrices, as well as the direct/kernel fomulations.

Comments welcome !

@@ -854,7 +859,11 @@ def _errors_and_values_helper(self, alpha, y, v, Q, QT_y):
-----
We don't construct matrix G, instead compute action on y & diagonal.
"""
w = 1.0 / (v + alpha)
w = 1. / (v + alpha)
dummy_column = np.var(Q, 0) < 1.e-12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I would call this "constant_column" rather than "dummy_column", no?

@GaelVaroquaux
Copy link
Member

A few minor comments that I would like addressed :)


centered_kernel = True
if sparse.issparse(X) or not self.fit_intercept:
centered_kernel = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be written:

centered_kernel = not sparse.issparse(X) and self.fit_intercept

@ogrisel
Copy link
Member

ogrisel commented Sep 13, 2016

LGTM as well. @mblondel do you want to have a look? Otherwise we can merge.

@ogrisel ogrisel changed the title MRG: Fix gcv [MRG+2]: Fix Ridge GCV with centered data Sep 13, 2016
@bthirion
Copy link
Member Author

@ogrisel, addressed your comments and rebased on master.

@mblondel
Copy link
Member

Thanks for the fix! Feel free to merge without my review.

@amueller
Copy link
Member

flake8 is complaining ;)

@bthirion
Copy link
Member Author

Fixed.

@ogrisel ogrisel merged commit b32897f into scikit-learn:master Oct 5, 2016
@ogrisel
Copy link
Member

ogrisel commented Oct 5, 2016

Merged. I will add a whats new to master directly.

ogrisel added a commit that referenced this pull request Oct 5, 2016
amueller pushed a commit to amueller/scikit-learn that referenced this pull request Oct 14, 2016
amueller added a commit to amueller/scikit-learn that referenced this pull request Oct 14, 2016
# Conflicts:
#	doc/whats_new.rst
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants