[ENH] Add NaiveProbaRegressor using distribution fitter - #1108
[ENH] Add NaiveProbaRegressor using distribution fitter#1108patelchaitany wants to merge 2 commits into
Conversation
Adds a naive baseline probabilistic regressor that pools all training target values, fits a single distribution via a configurable distfitter, and broadcasts that distribution at prediction time.
|
|
||
| return self | ||
|
|
||
| def _predict(self, X): |
There was a problem hiding this comment.
this is already the default, so it does not need to be copy-pasted
| dist = self.distribution_ | ||
| params = dist.get_params() | ||
|
|
||
| broadcast_params = {} |
There was a problem hiding this comment.
this is brittle since it works only for some distributions.
I think there should be a general public API mechanism for this kind of broadcasting.
I believe this exists, by wrapping distributions in the IID class - not sure if there is a more elegant way.
I could imagine, for instance, if the distribution is "parametric" (as per the distribution type tag) that we can do what you are doing below. But, not for all distributions.
fkiraly
left a comment
There was a problem hiding this comment.
Very nice - see above for a comment on ensuring that broadcasting always works.
We should, in particular, test the EmpiricalFitter, since there the current logic would fail!
Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>
|
@fkiraly, Let me know if any more changes needed |
Adds a naive baseline probabilistic regressor that pools all training target values, fits a single distribution via a configurable distfitter, and broadcasts that distribution at prediction time.
Reference Issues/PRs
#1085
What does this implement/fix? Explain your changes.
Does your contribution introduce a new dependency? If yes, which one?
What should a reviewer concentrate their feedback on?
Did you add any tests for the change?
Any other comments?
PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
skproroot directory (not theCONTRIBUTORS.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 pluscodeif you also fixed the bug in the PR).maintenance- CI, test framework, release.See here for full badge reference
For new estimators
docs/source/api_reference/taskname.rst, follow the pattern.Examplessection.python_dependenciestag and ensureddependency isolation, see the estimator dependencies guide.