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

DeadZoneRegressor support for "constant" effect #588

Merged
merged 5 commits into from
Oct 21, 2023

Conversation

FBruzzesi
Copy link
Collaborator

Description

The PR solves #587 by adding support for effect="constant".

Additionally, as discussed in the issue, it removes the need of autograd by implementing derivative by hand (😂) and by using scipy.optimize.minimize for optimization.

This leads to a few potential breaking changing in the API as the following argument are no longer needed:

  • n_iter
  • stepsize
  • check_grad

and the following attributes are no longer available:

  • loss_log_
  • self.wts_log_
  • deriv_log_

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines (flake8)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (also to the readme.md)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added tests to check whether the new feature adheres to the sklearn convention
  • New and existing unit tests pass locally with my changes

If you feel your PR is ready for a review, ping @koaning or @MBrouns.

sklego/linear_model.py Outdated Show resolved Hide resolved
Comment on lines +28 to +29
if mod.effect == "constant":
pytest.skip("Constant effect")
Copy link
Collaborator Author

@FBruzzesi FBruzzesi Oct 20, 2023

Choose a reason for hiding this comment

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

Constant effect gets not even close to target values 😞

koaning and others added 2 commits October 20, 2023 22:29
Co-authored-by: Francesco Bruzzesi <42817048+FBruzzesi@users.noreply.github.com>
Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

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

LGTM. Nice to have autograd out of here.

@FBruzzesi FBruzzesi merged commit 9f48e79 into koaning:main Oct 21, 2023
7 checks passed
@FBruzzesi FBruzzesi deleted the patch/deadzone-fix branch October 21, 2023 14:53
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.

2 participants