[ENH] EmpiricalFitter distribution fitter - #1095
Conversation
Adds EmpiricalFitter which converts the full sample into an Empirical distribution. For the univariate case (empirical per variable), it simply wraps the data in an Empirical distribution. Useful as a base component for naive distribution fitting in ensemble or reduction strategies.
EmpiricalFitter distribution fitter
fkiraly
left a comment
There was a problem hiding this comment.
I think this is not correct, since the result should be an 0D distribution, but it is a 2D distribution.
|
please ensure to fix code quality failures too. Please look at the developer guide. |
…tion Previously, multi-column data was reshaped into a 2D Empirical distribution via MultiIndex, which violated the contract that proba() must return a scalar (0D) distribution. Now all values are raveled into a single-column DataFrame, producing a scalar distribution regardless of input shape.
|
Fixed as per your review: |
| """ | ||
|
|
||
| _tags = { | ||
| "authors": ["fkiraly"], |
There was a problem hiding this comment.
I think you are the author for this class
| } | ||
|
|
||
| def __init__(self, time_indep=True): | ||
| self.time_indep = time_indep |
There was a problem hiding this comment.
There is no need for this as we are flattening the data so this time_indep is going to make no difference as there is going to be an single row
|
Addressed review feedback:
|
Fixes #1087.
Adds
EmpiricalFitterwhich converts the full sample into anEmpiricaldistribution. For the univariate case (empirical per variable), it simply wraps the data in anEmpiricaldistribution.Supports single-column and multi-column data, with a
time_indepparameter passed through toEmpirical.Useful as a base component for naive distribution fitting in ensemble or reduction strategies.