-
Notifications
You must be signed in to change notification settings - Fork 135
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
Changing Default Values of plotting and prediction percentiles #250
Conversation
change of notebook will be done after approval. it is more for cosmetic than any syntax/runtime error. |
this also requires a docs update? the update is done or not yet? |
orbit/models/lgt.py
Outdated
@@ -792,7 +792,7 @@ class LGTFull(BaseLGT): | |||
""" | |||
_supported_estimator_types = [StanEstimatorMCMC, StanEstimatorVI, PyroEstimatorVI] | |||
|
|||
def __init__(self, n_bootstrap_draws=None, prediction_percentiles=None, **kwargs): | |||
def __init__(self, n_bootstrap_draws=None, prediction_percentiles=[5, 95], **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd very strong urge against this. Default args being mutable is generally a bad idea. (I think this is a good description of why: https://docs.python-guide.org/writing/gotchas/)
I'd suggest setting following the design of the otther args and set the default in _set_default_base_args()
@edwinnglabs @wangzhishi Also worth noting that changing the default value here changes the output for |
As mentioned, they are not material since i am adding an argument on top of a None default. So the old notebooks should work perfectly. it's just cosmetic since we are putting an input that is already default (in this refined version). But I can do that ONLY after we agree this is the change. @wangzhishi |
are you just against the idea of renaming the output to x_upper and x_lower or just against the idea having a list in default argument? @steveyang90 |
Hey sorry let me clarify a bit, because I think there are multiple points! We should definitely not set the default explicitly in the method signature to The second part is the unit test that you updated. Where is "prediction_lower" and "prediction_upper" coming from? Was this a recent change? Last I recall, we were using the actual ints for the intervals since users can put in an arbitrary list of ints, not just upper and lower? |
So for the first point, I would prefer to set the percentiles default as [5, 95] using the As regard to the second point, we changed to upper and lower some version ago. I find it is annoying to keep tracking what we input originally in the model to pipe the same into plotting and we will only plot one band with two end points anyway. So I feel converting them into ['upper' and 'lower'] may actually make more sense. However, I don't completely oppose to use |
Cool, I think we're agreed on the first point then! Regarding the second point, I see what you mean with plotting. So maybe the solution is to be more restrictive with |
- relabel output to {x}_{p} where `x` is the prediction component and `p` is the input prediction percentile - set prediction percentile default to be [5, 95] with an internal function to dodge mutable input - set prediction percentile deault to [5, 95] in plot functions in the similar way of above - within plot functions, it searches for {x}_{p} format again for columns to plot
Description
Having prediction percentiles=
None
is quite annoying since I find more often the reason to have LGT/DTLFull is to get reliable inference. Each time if I want to create a new DLTFULL(after testing DLTMAP), i need to figure out the right arg.Fixes # (issue)
Change
prediction_percentiles=None
=prediction_percentiles=[5,95]
and some default plotting value changed to make it less input required if we always use default prediction outcomes.Please delete options that are not relevant.
How Has This Been Tested?
Since it is plotting, no test is related for this.