Add DistfitFitter distribution fitter wrapping the distfit package - #1097
Open
pyarchana wants to merge 7 commits into
Open
Add DistfitFitter distribution fitter wrapping the distfit package#1097pyarchana wants to merge 7 commits into
pyarchana wants to merge 7 commits into
Conversation
pyarchana
marked this pull request as ready for review
July 10, 2026 01:03
| "login": "areychana", | ||
| "name": "Archana K.", | ||
| "avatar_url": "https://avatars.githubusercontent.com/u/93970069?v=4", | ||
| "profile": "https://github.com/areychana", |
Member
There was a problem hiding this comment.
i think your github is wrong.
Author
There was a problem hiding this comment.
i have recently changed the username, i will update it here too!
Member
|
@pyarchana, add DistfitFitter under Parametric fitters in that RST file |
| model = dfit.model | ||
| self.dist_name_ = model["name"] | ||
| self.shape_args_ = tuple(model["arg"]) | ||
| self.dist_loc_ = float(model["loc"]) |
Member
There was a problem hiding this comment.
this are the not documentted, Should't we document this?
fkiraly
requested changes
Aug 30, 2026
fkiraly
left a comment
Collaborator
There was a problem hiding this comment.
Thanks!
- the distribution returned should be existing distributions in
skpro, not a new distribution without any clear features. - for tests, use
run_test_for_classinstead of an explicit dependency check
Author
thanks!
|
…fit-fitter # Conflicts: # docs/source/api_reference/distfitter.rst # skpro/distfitter/__init__.py
Author
|
to be clear on where this is: |
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
Towards #1086.
What does this implement/fix? Explain your changes.
Adds
DistfitFitter, askprodistribution fitter that wraps thedistfitpackage's parametric fitting mode: it fits a set of candidatescipy.statsdistributions to the data, scores them, and returns the best-scoring one as a fittedskproscalar distribution. It follows the existingEmpiricalFitter/NormalFitterpattern (_fit/_proba,get_test_params).Rather than reimplementing pdf/cdf/mean/var per distribution, the returned distribution reuses skpro's existing
_ScipyAdapter(skpro/distributions/adapters/scipy/) via a small private wrapper (_DistfitDistribution) that takes the scipy distribution name and shape/loc/scale thatdistfitproduces.Currently scoped to
distfit'smethod="parametric"mode only. I checkeddistfit's other three modes (quantile,percentile,discrete) and they return a differently shaped model dict that this adapter doesn't handle yet. Happy to extend if that's wanted before merge, or leave it for a follow-up.Does your contribution introduce a new dependency? If yes, which one?
distfit, but it's already listed inpyproject.toml'sall_extras, so no dependency-list changes were needed.What should a reviewer concentrate their feedback on?
method="parametric"is acceptable for a first version, or whether the other threedistfitmodes should be wired up before merge._DistfitDistributionadapter design (reuse of_ScipyAdaptervs. an alternative approach).BaseDistFitterand thedistfitterregistry entry are already onmain).Did you add any tests for the change?
Yes:
skpro/distfitter/tests/test_distfitfitter.py, plus it's automatically picked up by the existing genericTestAllDistFitterscontract test suite.Any other comments?
Opened as draft for early feedback on scope. Full local test suite, doctest, and lint (black/isort/flake8/pydocstyle) pass.
Note:
docs/source/api_reference/distfitter.rstdoesn't exist yet. The wholedistfittermodule (EmpiricalFitter,NormalFitter,MOMFitter) is currently undocumented there, not just this PR's addition. Flagging it here rather than silently leaving the checklist item unchecked. Happy to add the doc file for the whole module as part of this PR if that's preferred, or leave it for a separate cleanup PR. Let me know which you'd rather I do.PR checklist
For all contributions
For new estimators
Examplessection.python_dependenciestag and ensured dependency isolation.