Repository navigation
bug fix - #291
Merged
Mike Tokic (mitokic) merged 1 commit intoOct 15, 2026
Merged
bug fix#291
Conversation
Mike Tokic (mitokic)
requested review from
smdp2000ofc
and
a balanced review from Copilot
October 15, 2026 21:00
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Validation remains unverified; devtools::test(filter = "clamp_negative_target") and devtools::check() need confirmation before approval.
0 open findings
What changed in this PR
Preserves Croston historical actuals throughout FinnTS backtests and downstream outputs while retaining non-negative training targets.
Changes:
- Saves original targets before Croston clamping.
- Adds regression coverage for assessment actuals, CSV outputs, and model averages.
- Updates release notes and package version to
0.7.0.9013.
| File | Description |
|---|---|
| tests/testthat/test-clamp_negative_target.R | Tests actual preservation and downstream outputs. |
| R/train_models.R | Preserves original targets before clamping. |
| NEWS.md | Documents the Croston correction. |
| DESCRIPTION | Advances the development version. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
smdp2000ofc
approved these changes
Oct 15, 2026
Mike Tokic (mitokic)
deleted the
mitokic/10152026/back-test-target-issue
branch
October 15, 2026 22:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the Croston model handling to ensure that historical actuals are preserved in backtests, CSV outputs, and model averages, while continuing to clamp negative targets only during Croston training. It also adds comprehensive tests to validate this behavior and updates documentation accordingly.
Bug Fixes and Improvements for Croston Model:
clamp_negative_targetfunction now saves the originalTargetvalues in aTarget_Originalcolumn (if not already present) before clamping, ensuring that assessment actuals remain unchanged and only training data is affected.Testing Enhancements:
Documentation and Metadata Updates:
0.7.0.9013inDESCRIPTIONandNEWS.mdto reflect these changes. [1] [2]