-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implement a Sigmoid.standard_parameters
method
#169
Conversation
To get the parameters estimate as standard parameters from a
It's not very convenient, we might want to add a method |
This looks good @pberkes : I like the fact that you are finally leveraging the object hierarchy already available in One thing I am left wondering about is: what happens if someone wants to implement a sigmoid that does not have a corresponding distribution in I am not sure that writing your own sigmoid is such an important use case, but it is at least worth a clear note in the docs of the module. |
And please feel free to merge after addressing my comment :-) |
@otizonaizit I wondered the same... I thought I could do:
Idk in my opinion the probability that someone writes their own sigmoid is low, and that some writes one that does not correspond to one of the distributions in scipy even lower (but that's my uneducated guess). The low probability does not justify a complex hierarchy, in my opinion. Another possibility is to merge 1)+2) and have a base class Sigmoid with abstract _value, _slope, _threshold, and _standard_parameters, and also the current implementation with _scipy_distr. That would allow defining a new subclass that has a bogus _scipy_distr and implements _value, _slope, _threshold, and _standard_parameters directly. Architecturally it's not very clean, it's kind of a compromise solution. what do you think? |
another option is to just document what is the expected public API of a If I look at the code it seems to me that we are only using So what about explaining in the docs what these methods are supposed to return? We can then say that in the case of a distribution that is already available in So, just change the docs but leave the code as it is in this PR? |
@otizonaizit ok so if I understand, option 2 is what we want. I reintroduced |
Yes, this is cool! Before merging you could still add the method to the |
Added |
Fix #160
Once I implemented the standard parameters, there was no reason to have the hand-written formulas for the rest around. I changed all sigmoids to use the
scipy.stats
implementation of the distribution, which are more optimized and use numerically robust equations.As a result, the code is simpler now.