Skip to content

Conversation

geetu040
Copy link
Member

@geetu040 geetu040 commented Oct 8, 2025

Reference Issues/PRs

Fixes #8762

Does your contribution introduce a new dependency? If yes, which one?

No

What should a reviewer concentrate their feedback on?

predict methods

Did you add any tests for the change?

Not yet

PR checklist

For all contributions
  • Optionally, for added estimators: I've added myself and possibly to the maintainers tag - do this if you want to become the owner or maintainer of an estimator you added.
    See here for further details on the algorithm maintainer role.
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.

Copy link
Member Author

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: @marrov @ankurankan @fkiraly
This is the draft implementation. Please take a look at _predict to see if it's going in the right direction. I am implementing other methods meanwhile. Also I've left a few quesition in the review please take a look at them as well.

Comment on lines +55 to +56
fh_in_sample_mask = fh._is_in_sample()
fh_out_of_sample_mask = fh._is_out_of_sample()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to use these private methods of ForecastingHorizon, I didn't see them being used elsewhere.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are the public methods is_all_in_sample and is_all_out_of_sample, these are safer

Comment on lines +65 to +68
from sktime.split import CutoffSplitter

fh_in_sample = _y.shape[0] + fh_in_sample - 1
cv = CutoffSplitter(fh_in_sample)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From discussion in the parent issue #8762 cv object is expected from the user, but how do we make sure that the user's cv is expected to created the right splits? CutoffSplitter cuts off the samples till the in-sample fh. Or I might be missing something here, please let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "the right splits"?

Comment on lines +70 to +72
preds_in_sample = self.forecaster_.update_predict(
_y, cv, X, update_params=False, reset_forecaster=True
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think its fine to use update_predict here or should have it been a custom implementation? Because internally the fitted model, though it's using the correct context when predicting, yet it has seen the in-sample points during fit

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, then do we not need to pass less data to self_forecaster_ in its fit? Optimally, the points should not have already been seen in fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] forecaster wrapper that ensures in-sample forecasts are out-of-sample rolling forecasts of a given horizon
2 participants