-
-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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 LinearRegression sparse + intercept + sample_weight #22891
FIX LinearRegression sparse + intercept + sample_weight #22891
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.
nice catch @jeremiedbb !
thx for digging into this.
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.
LGTM, just a nitpick about a local variable name:
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.
Very nice.
@jeremiedbb Did you already start with the same for |
Partial fix for #15438
Fixes #19578
This PR fixes the issue for LinearRegression only. I intend to check other linear models in separate PR(s).
To account for sample weight, we rescale X and y. When X is sparse we also need to rescale X_offset because the centering is implicit.
ping @agramfort