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] further improvements on BaseDistribution
and tests
#21
Comments
FYI @Alex-JG3 - your feedback would be very much appreciated, given that you implemented a distrubtion. |
@fkiraly, generally I found it quite clear how to adapt what has been done already to the t-distribution. The implementation of the normal distribution is a great example. Some things that were less clear to me:
It might be nice to be able to pass data structures other than pandas dataframes (link numpy arrays or lists) into |
I see - imo this is crucial to use it in an Subsetting by name is also a bonus, e.g., in the hierarchical setting, a hierarchical time series to an interval of days.
Have you tried using The other primary use case is probabilistic regression as in this (at the moment very rudimentary) notebook: |
Yes, good idea! I also thought about that initially and decided against, as it would incur boilerplate. However, if we go with the private/public split, we can sandwich boilerplate for conversions. |
Ah, yes - we should point that out in an extension template. |
@fkiraly, can I take a look at this one?
Just to make sure I know what you want, in the classes that inherit the It looks like we could make the Does that sound like a good solution or did you have something else in mind? |
Yes, exactly what I thought! The task is more general, as in finding the best design for this - but I think your idea is a very good solution. It is how I would have started.
Or, you could call it in in the parent
A subtle problem is, if you go through all the examples, it turns out that not always all parameters have to be broadcast, even if you ignore I would solve that with having a dedicated tag that lists all the params that broadcast. |
Yes, much obliged! I will then focus on splitting private/public, we can then put the too together and they should not interact too much. |
Closes #55, see also #21. 1. Adds a test to check whether the log of the `pdf` function is similar to the `log_pdf` function for each distribution. 2. Adds a test to check that the `ppf` is the inverse of the `cdf` function. This test required the change described in 1 to use `np.allclose`. 3. Adds a test to check that `pandas`outputs of methods have all `numeric` `dtype`-s Also fixes one instance that would have failed 2, 3: * Changes the method for converting datatypes in the `_apply_per_ix` function of the `Empirical` distribution. Switches to use `to_numeric` instead of `convert_dtypes`.
…stribution param broadcasting in base class (#5176) Mirror of [sktime/skpro#21 Moves the `_get_bc_params` method from child distributions to the parent distribtion class, `BaseDistribution`. This implementation is quite simple and doesn't use `_tags` and still means the child distributions have to call the `_get_bc_params` method.
From implementing a few distributions, some insights on potential improvements:
pdf
/_pdf
, similar tosktime
'sfit
/_fit
cdf
being inverse toppf
, orpdf
andlog_pdf
being compatible, or more sophisticated tests such as subtracting themean
shifting functions (or not affecting them) accordinglyiloc
andloc
indexing needs to be thought out so it can affect parametersloc
,iloc
, should be testedThe text was updated successfully, but these errors were encountered: