Repository navigation
Mitokic/10312026/hts blank bug - #300
Open
Mike Tokic (mitokic) wants to merge 7 commits into
Open
Mike Tokic (mitokic) wants to merge 7 commits into
Mike Tokic (mitokic) wants to merge 7 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Missing values and literal "NA" silently merge distinct groups before collision checks, requiring per-column ambiguity validation in preparation and hierarchy detection plus regression coverage.
1 open issue
1 file not reviewed
man/detect_hierarchy.Rd: Generated file
What changed in this PR
This PR improves FinnTS hierarchical forecasting by handling missing combo labels and aligning series names across target aggregation and external-regressor joins.
Changes:
- Represent missing grouped labels as
"NA"and update hierarchy detection. - Centralize series-name cleanup, reject cleanup collisions, and fix regressor joins for digit-prefixed series.
- Add regression coverage, update documentation, and advance the development version to
0.7.0.9020.
| File | Description |
|---|---|
vignettes/hierarchical-forecasting.Rmd |
Explain missing labels and naming collisions. |
tests/testthat/test-hierarchical.R |
Cover missing-label grouping and reconciliation. |
tests/testthat/test-hierarchical-xreg.R |
Test numeric labels, regressor joins, and collisions. |
tests/testthat/test-detect-hierarchy.R |
Update missing and invalid label expectations. |
tests/testthat/test-agent-hierarchy-compatibility.R |
Align detector expectations for missing labels. |
R/hierarchy.R |
Normalize missing groups and centralize series naming. |
R/detect_hierarchy.R |
Allow missing labels while rejecting blanks and nonfinite values. |
NEWS.md |
Document fixes and restart guidance. |
man/detect_hierarchy.Rd |
Update public label-handling documentation. |
DESCRIPTION |
Bump the development version. |
Review effort: Balanced
This branch has not been deployed
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 handling of missing and ambiguous combo variable values in hierarchical forecasting, improves the reliability of hierarchical series naming, and adds comprehensive tests to ensure correct behavior. The changes make hierarchical forecasts more robust to missing values, prevent silent merging of series with ambiguous names, and ensure external regressors are correctly mapped to all bottom-level series, including those with numeric or special names.
Hierarchical combo value handling and naming:
"NA"label, consistent withprep_data()and other naming conventions, instead of causing errors. This ensures that grouped hierarchical forecasts reconcile correctly even when combo variables have missing values. [1] [2] [3] [4] [5] [6]hts_node_names()ensures that all hierarchy series names are syntactic, unique, and consistent across the package. It raises an explicit error if two series would map to the same name after cleanup (e.g.,"A.B"vs."A_B"), preventing silent data merging. [1] [2]External regressor and series compatibility:
Error handling and validation:
"NA". [1] [2] [3]Testing and documentation:
"NA", that ambiguous or colliding series names are detected early, and that regressor mapping works for all valid series names. [1] [2] [3]Version bump:
0.7.0.9020to reflect these improvements and bug fixes. [1] [2]These changes improve the reliability and clarity of hierarchical forecasting, especially in the presence of missing or ambiguous combo values.