-
Notifications
You must be signed in to change notification settings - Fork 47
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
[BUG] Fix residual scale estimation in DoubleResidual #503
base: main
Are you sure you want to change the base?
Conversation
…dd a warning for t dist df<3 trafo=squared, where we observe poor performance.
…n base and residual.
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!
Would you like a review right now, or is this still a work-in-progress draft?
Some comments:
- we should not change the core interface in the same pull request as changes to estimators. Your idea of adding a
sample_weight
arg is great, but we should deal with this separately, to avoid interaction between the changes! - changes to the residual estimator look good and sensible. I will have to sit down and work out the math to check, but superficially fine.
@@ -72,7 +72,7 @@ def __rmul__(self, other): | |||
else: | |||
return NotImplemented | |||
|
|||
def fit(self, X, y, C=None): | |||
def fit(self, X, y, C=None, sample_weight=None): |
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.
as said, good idea, but should be in a separate PR. Could you also open an issue to track adding sample weights?
What we should do (please copy this recommendation in an issue):
- add a tag
capability:sample_weight
that tells the user whether the weights are used non-trivially - add tests in
TestAllRegressors
that actually passes sample weights, to see that nothing breaks. In particular, nothing should break for any estimator when passed, the current boilerplate would lead to most estimators breaking, as the argument is passed on to_fit
! - in particular, the boilerplate should check the tag, and pass
sample_weight
on to_fit
only if the tag has valueTrue
. - in the tests, we should check that
_fit
does have the argsample_weight
if the tag is setTrue
.
Reference Issues/PRs
Fixes #492
What does this implement/fix? Explain your changes.
Changes to ResidualDouble:
Does your contribution introduce a new dependency? If yes, which one?
no
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
Added tests to confirm uniform quantiles for held out data when the model is correctly specified.