Skip to content

[ENH] Zero-Inflated Poisson and Negative Binomial shorthand distributions#845

Closed
MurtuzaShaikh26 wants to merge 1 commit into
sktime:mainfrom
MurtuzaShaikh26:zi-distributions
Closed

[ENH] Zero-Inflated Poisson and Negative Binomial shorthand distributions#845
MurtuzaShaikh26 wants to merge 1 commit into
sktime:mainfrom
MurtuzaShaikh26:zi-distributions

Conversation

@MurtuzaShaikh26
Copy link
Copy Markdown

@MurtuzaShaikh26 MurtuzaShaikh26 commented Mar 10, 2026

Reference Issues/PRs:
Contributes to #554.

What does this implement/fix?

Adds two shorthand distribution classes for commonly used zero-inflated distributions:

  • [ZIPoisson] — Zero-Inflated Poisson, equivalent to [ZeroInflated(p=p, distribution=Poisson(mu=mu))]
  • [ZINB] — Zero-Inflated Negative Binomial, equivalent to [ZeroInflated(p=p, distribution=NegativeBinomial(mu=mu, alpha=alpha))]
    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:
  • New: [skpro/distributions/zi_poisson.py](
  • New: [skpro/distributions/zi_negative_binomial.py]
  • Modified: [skpro/distributions/init.py] — added exports

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?

  • Whether the internal delegation pattern (composing via [ZeroInflated] property is appropriate vs using [_DelegatedDistribution].
  • Whether additional [get_test_params] configurations are needed.

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 BaseDistribution subclassing with internal delegation was used instead.

PR checklist:
For all contributions

  • I've added myself to the list of contributors with any new badges I've earned :-)
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG].
    For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured dependency isolation. (N/A- no soft dependencies)

@marrov
Copy link
Copy Markdown
Member

marrov commented Mar 10, 2026

Closing this as there's already an open PR (#713) to solve the underlying issue.

@marrov marrov closed this Mar 10, 2026
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