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

[ENH] improved boilerplate for distribution objects #251

Open
fkiraly opened this issue Apr 17, 2024 · 1 comment
Open

[ENH] improved boilerplate for distribution objects #251

fkiraly opened this issue Apr 17, 2024 · 1 comment
Labels
API design API design & software architecture enhancement module:probability&simulation probability distributions and simulators

Comments

@fkiraly
Copy link
Collaborator

fkiraly commented Apr 17, 2024

Notes on improving boilerplate for distribution objects:

  • creating boilerplate layer - this should encompass broadcasting, index/column subsetting at the start of methods.
  • we should think about dynamic docstrings to contain explicit formulae for different distribution methods, where available. Possibly a dict with math formulae, and the same approach as set_config in sktime.
  • it would be good to also support parameter/index cases for scalar and multivariate single-instance. In the first case, the behaviour should return scalars, in the second, 2D tables.

Also for discussion.

@fkiraly fkiraly added enhancement module:probability&simulation probability distributions and simulators API design API design & software architecture labels Apr 17, 2024
@fkiraly fkiraly changed the title [ENH] improved boilerplate for distibution objects [ENH] improved boilerplate for distribution objects Apr 18, 2024
fkiraly added a commit that referenced this issue Apr 23, 2024
Towards #251.

This PR refactors the probability distributions, inheriting from
`BaseDistribution`:

* adds a boilerplate layer dealing with input coercion, formatting,
indices
* extension points move from public to private under boilerplate, e.g.,
to `_pdf` from `pdf`
* an extension template is added, detailing the extension contract,
fixes #23
* distributions are now polymorphic - if all parameters are scalar, and
no index is given, behaves as a scalar. Otherwise behaves as a 2D array
distribution, as before.

Also refactors all distributions with "non-complex" signature, and also
with exception of QPD (which is subject to multiple other PRs)
@fkiraly
Copy link
Collaborator Author

fkiraly commented May 22, 2024

Covered by #265, except dynamic docstrings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API design API design & software architecture enhancement module:probability&simulation probability distributions and simulators
Projects
None yet
Development

No branches or pull requests

1 participant