-
Notifications
You must be signed in to change notification settings - Fork 220
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
Rename fit_method
parameter
#1366
Comments
@wd60622 this crossed my mind as well when I worked on #1266. I should preface by saying the "fit_method" convention is over two years old and changing it could break the codebases of many, many users, but I never liked that param name either. I don't want to use "method" because of the standard Python definition for that term (i.e. any function written inside a class object).
Perhaps I'm overthinking this. What are your thoughts? |
I am not against "method" as it is not a keyword in python
That seems to fall apart with map For me,
I'm not concerned about this. We can just deprecate it. Even if it was a keyword argument, we can just support both for a time being and have a warning. Juan and I discussed a 2 release cycle deprecation a while back with some MMM items. We could do that here as well. For instance, def fit(self, method: str = "mcmc", fit_method: str | None = None, **kwargs):
if method and fit_method:
raise ValueError("Both method and fit_method cannot be used. Use method in the future")
if fit_method is not None:
warnings.warn("This will be deprecated in two releases. Use method instead.", DeprecationWarning)
method = fit_method
...
# This stays the same
model.fit("map")
# Gets a deprecation warning
model.fit(fit_method="map") |
This might conflict with one of the parameters of pm.sample but I find
model.fit(fit_method="something")
redundantpymc-marketing/pymc_marketing/clv/models/basic.py
Lines 97 to 99 in 7dfa955
I think
model.fit(method="something")
reads a bit better. Maybemodel.fit(algorithm="something")
if there is a conflict.Thoughts @ColtAllen
The text was updated successfully, but these errors were encountered: