-
Notifications
You must be signed in to change notification settings - Fork 77
[ENH] Check for distribution objects and handle them with iat/iloc #644
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
base: main
Are you sure you want to change the base?
Conversation
fkiraly
left a comment
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.
Brilliant!
Could you extend this to one of the existing composite distributions where this is currently done manually, and ensure this works for them? I.e., remove the custom _iloc etc and check whether it works.
I successfully used the base-methods for The five distributions I tested show, that this needs some additional work for all distributions. How should we proceed? Should I:
|
|
Can you explain why it is not as easy as just delete the custom |
For the I haven't looked that much into the |
|
ok - are there any cases that we can remove without adaptation? If so, we could just remove those that we can and leave the others as future todos? |
I do not see any at the moment. Here are some of composite dist. and some of the problems or complexities I see: Hurdle - Numpy broadcasting with undersized params |
|
so the addition is basically dead code then? |
This is difficult for me to interpret. Is it:
This PR successfully uses base methods for 3 composite distribution, removes ~85 lines of source-code and provides multiple tests. Even though the issue is not fully solved, I see this PR as a success. It provides a starting point for more refactoring to align the different composite distributions. I could go further and continue working on more distributions (if that is required), but I see this PR as mergeable. |
Reference Issues/PRs
resolves #559
What does this implement/fix? Explain your changes.
The source code changes are just the
isinstancecheck for distribution objects and using iat/iloc for scalars or arrays. This PR also adds multiple tests and the_CompositeDistributionTester(which is used in the new tests).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?
Any other comments?
PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
skproroot directory (not theCONTRIBUTORS.md). Common badges:code- fixing a bug, or adding code logic.doc- writing or improving documentation or docstrings.bug- reporting or diagnosing a bug (get this pluscodeif you also fixed the bug in the PR).maintenance- CI, test framework, release.See here for full badge reference
For new estimators
docs/source/api_reference/taskname.rst, follow the pattern.Examplessection.python_dependenciestag and ensureddependency isolation, see the estimator dependencies guide.