You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ENH] sktime time series regression integration #196
It would be nice to have an estimator level integration with time series regressors in the sktime package. https://github.com/sktime/sktime
This would require:
a BaseExperiment descendant class SktimeRegressionExperiment which carries out a cross-validation experiment for time series regressors. This can lean on SktimeClassificationExperiment, in particular when handling metrics. In hyperactive.experiment.integrations. Also see the extension template https://github.com/SimonBlanke/Hyperactive/blob/main/extension_templates/experiments.py
a TSROptCv class inheriting from sktimeBaseRegressor similar to the other classes in hyperactive.integrations. Internally, it uses the SktimeRegressionExperiment
Hey @fkiraly, I would like to work on this issue. I have gone through the existing code and PRs related to integration (#173 & #200 ). Please let me know if I should know anything else
From the discussion, it appeared that an evaluate utility would be introduced for both TSC and TSR, However, in the PRs I only see the evaluate function implemented under: sktime.classification.model_evaluation and there doesnt seem to be a similar sktime.regression.model_evaluation
Should TSR also have a evaluate function similar to the TSC or does evaluation utility for regression already exist elsewhere and I may be overlooking it?
Currently, if I look under the hood, there is nothing that seems to prevent us from using the classification evaluate for regression.
Could you check if this is the case? If so, then I would do the following:
modify the evaluate docstring in sktime that clearly states that it also allows to use regressors
add a folder in regression that mirrors the one in classification, but it only imports the existing evaluate
modify the docstring of the experiment in hyperactive that it also covers regressors
In both cases, some thinking may have to go into the default score - determining whether the estimator is a classifier or regressor can be done using the object_type tag.
However, if there are good reasons why a separate evaluate may be needed, I would suggest to first discuss here then.
I think the core logic is largely similar, but combining regression and classification into a single evaluate function would require few if/else branches to handle cases like avoiding predict_proba (classification-only) for regressors and setting different default scoring as you mentioned.
Given that models are kept isolated in sktime, it is consistent for the evaluation functions to follow the same structure and remain separate. While this introduces some DRY tradeoff, the resulting code would be more understandable
I think the core logic is largely similar, but combining regression and classification into a single evaluate function would require few if/else branches to handle cases like avoiding predict_proba (classification-only) for regressors and setting different default scoring as you mentioned.
Given that models are kept isolated in sktime, it is consistent for the evaluation functions to follow the same structure and remain separate. While this introduces some DRY tradeoff, the resulting code would be more understandable
Hey @Omswastik-11, I noticed #209 integrates sktime regressors by reusing classification evaluate utility. I am planning to work on adding this regression-side evaluate in sktime, but wanted to check first if you are already working on it so as to avoid duplication
Hi @Khushmagrawal !! Thanks for pointing out. I was also wandering why there is no separate evaluation utility for Sktime regression so I tried with classification . For now it seems correct. I will dig more into it and let you know if that can help you writing a new evaluate for Sktime regression. I was thinking to adding this regression-side evaluate in sktime but you can proceed with this. Plz ping me when you done with changes I will modify the Sktime regression integration accordingly .
Activity
Khushmagrawal commentedon Nov 15, 2025
Hey @fkiraly, I would like to work on this issue. I have gone through the existing code and PRs related to integration (#173 & #200 ). Please let me know if I should know anything else
fkiraly commentedon Nov 16, 2025
Great! It is very similar to time series classification.
Once this is added to hyperactive, there is a second setp to add a record in
sktime.Khushmagrawal commentedon Nov 22, 2025
Hey @fkiraly, While implementing the
SktimeRegressionExperiment,following theSktimeClassificationExperimentdesign, I tried locating corresponding evaluate utility for regression. I went through some related issues sktime/sktime#6852 & sktime/sktime#6708) and PRs (sktime/sktime#6888 & sktime/sktime#8267)From the discussion, it appeared that an evaluate utility would be introduced for both TSC and TSR, However, in the PRs I only see the evaluate function implemented under:
sktime.classification.model_evaluationand there doesnt seem to be a similarsktime.regression.model_evaluationShould TSR also have a evaluate function similar to the TSC or does evaluation utility for regression already exist elsewhere and I may be overlooking it?
fkiraly commentedon Nov 22, 2025
Hm, interesting question.
Currently, if I look under the hood, there is nothing that seems to prevent us from using the classification
evaluatefor regression.Could you check if this is the case? If so, then I would do the following:
evaluatedocstring insktimethat clearly states that it also allows to use regressorsregressionthat mirrors the one inclassification, but it only imports the existingevaluatehyperactivethat it also covers regressorsIn both cases, some thinking may have to go into the default score - determining whether the estimator is a classifier or regressor can be done using the
object_typetag.However, if there are good reasons why a separate
evaluatemay be needed, I would suggest to first discuss here then.Khushmagrawal commentedon Nov 22, 2025
I think the core logic is largely similar, but combining regression and classification into a single
evaluatefunction would require fewif/elsebranches to handle cases like avoidingpredict_proba(classification-only) for regressors and setting different default scoring as you mentioned.Given that models are kept isolated in sktime, it is consistent for the evaluation functions to follow the same structure and remain separate. While this introduces some DRY tradeoff, the resulting code would be more understandable
Khushmagrawal commentedon Nov 28, 2025
Hey @Omswastik-11, I noticed #209 integrates sktime regressors by reusing classification
evaluateutility. I am planning to work on adding this regression-side evaluate in sktime, but wanted to check first if you are already working on it so as to avoid duplicationOmswastik-11 commentedon Nov 28, 2025
Hi @Khushmagrawal !! Thanks for pointing out. I was also wandering why there is no separate evaluation utility for Sktime regression so I tried with classification . For now it seems correct. I will dig more into it and let you know if that can help you writing a new evaluate for Sktime regression. I was thinking to adding this regression-side evaluate in sktime but you can proceed with this. Plz ping me when you done with changes I will modify the Sktime regression integration accordingly .