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] fitted parameter forwarding utility, forward statsforecast
estimators' fitted parameters
#6349
base: main
Are you sure you want to change the base?
Conversation
Not a review, just a clarification question
Based on the docstrings in extension templates, I had the understanding that existing base class already implements this, i.e. if I create |
That is correct, but that will not help with adapters, as there the fitted parameters are nested into a delegate, e.g., So the default There are multiple solutions here, out of these I think the one in this PR is best:
|
Thanks for the explanation, it makes sense now. I understand what you did here, but I have some hestation to make every single attribute ending with underscore as fitted parameters. These delegated estimators most likely (if not always) non sktime/sklearn package objects, and not all of our dependencies are sklearn compatible. They may follow different naming conventions and exposing all of them can mean exposing some internal properties as well as too many things to expose for end users. It's just a precautionary totally subjective hesitation, not a strong objection. |
@yarnabrina, could you explain, what is your caution against, specifically? I cannot see how this could cause excpetions, because:
|
I agree completely, that's not my worry. My caution is that this will expose every single attributes from underlying packages ending with underscore. I think this may be too many to be useful for end users, and few of them may not really fit well into the idea of "fitted parameters". As an example, if you try the statsforecast adapter, it'll expose
Please consider this with as much emphasis on subjective as possible. |
Can you confirm, your worry is "too many attributes that are not useful"?
Hm, I thought that was exactly what @jiayuanteng wanted though - perhaps they could confirm if that is the case or not? |
Yes, confirmed. |
Is that happening when you try out this PR with |
Sorry if I was not clear earlier. What I would like to have is to get fitted parameters (estimated coefficients) from the best model. |
Is this PR giving you access to the parameters? My question was about the actual @yarnabrina, would you agree that any dict is better than an empty dict? |
statsforecats
estimators' fitted parametersstatsforecast
estimators' fitted parameters
Yes, and I'd agree to merge this as default settings. But I'll prefer if adapter wise we can find better options customised for underlying soft dependency. For that, I'd prefer to wait for a day or two for a possible update from Nixtla if they can offer a better suggestion, at least for statsforecast. Are you planning to release this for 0.29.0 today? |
no, I was not - 0.29.0 only has maintenance/deprecation content above 0.28.1. |
This PR adds a fitted parameter forwarding utility which is useful for adapter classes. It copies fitted parameters in the sense of the
sklearn
convention that these end in underscore from any object - usually the delegate, nthe adapter case - to a target object - usuallyself
.Further, the utility is added to adapters as follows:
_GeneralisedStatsforecastAdapter
. This fixes [ENH] expose fitted params forstatsforecast
forecasters viaget_fitted_params
#5720_PytsAdapter
with the utility_TslearnAdapter
with the utility