[ENH] Zero-Inflated Poisson and Negative Binomial shorthand distributions#845
Closed
MurtuzaShaikh26 wants to merge 1 commit into
Closed
[ENH] Zero-Inflated Poisson and Negative Binomial shorthand distributions#845MurtuzaShaikh26 wants to merge 1 commit into
MurtuzaShaikh26 wants to merge 1 commit into
Conversation
Member
|
Closing this as there's already an open PR (#713) to solve the underlying issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs:
Contributes to #554.
What does this implement/fix?
Adds two shorthand distribution classes for commonly used zero-inflated distributions:
These internally delegate to the existing [ZeroInflated] compositor (merged in [ENH] zero-inflated distribution #648), providing a cleaner API for two of the most common zero-inflated distribution families used in intermittent demand forecasting.
Files:
Does your contribution introduce a new dependency? If yes, which one?
My contribution does not add a new dependency.
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
Both classes implement [get_test_params] with scalar and 2D array parameter sets, so they are automatically picked up by the existing [test_all_distrs.py] contract test suite.
Any other comments?
The [_DelegatedDistribution] base class was initially considered (as suggested in the issue), but it doesn't delegate [pmf]/[log_pmf] methods - only [pdf]/[log_pdf]. Since these are discrete distributions, direct
BaseDistributionsubclassing with internal delegation was used instead.PR checklist:
For all contributions
For new estimators
docs/source/api_reference/taskname.rst, follow the pattern.Examplessection.python_dependenciestag and ensured dependency isolation. (N/A- no soft dependencies)