skpro icon indicating copy to clipboard operation
skpro copied to clipboard

[ENH] zero-inflated distribution

Open Khushmagrawal opened this issue 1 month ago • 2 comments

Reference Issues/PRs

Partially towards #554 ~Blocked by #667~

What does this implement/fix? Explain your changes.

Adds support for Zero-inflated distribution

Does your contribution introduce a new dependency? If yes, which one?

No.

What should a reviewer concentrate their feedback on?

  • Correctness of the implementation
  • Design decision of making the lower bound inclusive in truncated.py

Did you add any tests for the change?

No

Any other comments?

After the ZeroInflated implementation is reviewed, I plan to add ZeroInflatedPoisson and ZeroInflatedNegativeBinomial as well using _DelegatedDistribution

PR checklist

For all contributions
  • [x] I've added myself to the list of contributors with any new badges I've earned :-) How to: add yourself to the all-contributors file in the skpro root directory (not the CONTRIBUTORS.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 plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release. See here for full badge reference
  • [x] The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • [x] I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • [x] 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, see the estimator dependencies guide.

Khushmagrawal avatar Nov 24 '25 11:11 Khushmagrawal

Fixed the off-by-one errors causing test_ppf_and_cdf to fail. The issue was due to floating-point error when q_rescaled is divided by p. Resolved by subtracting a small epsilon from q_rescaled (similar to #568). The workflow passes on my fork with this change

Khushmagrawal avatar Nov 27 '25 16:11 Khushmagrawal

This can now be re-reviewed as #667 is merged

Khushmagrawal avatar Dec 17 '25 17:12 Khushmagrawal