-
Notifications
You must be signed in to change notification settings - Fork 80
Remove unnecessary levels from multiindex columns to fix DifferencingTransform.inverse_transform
#503
Conversation
DifferencingTransform
DifferencingTransform.inverse_transform
DifferencingTransform.inverse_transform
DifferencingTransform.inverse_transform
Codecov Report
@@ Coverage Diff @@
## master #503 +/- ##
=======================================
Coverage 87.80% 87.80%
=======================================
Files 115 115
Lines 5454 5455 +1
=======================================
+ Hits 4789 4790 +1
Misses 665 665
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add test case
@@ -96,6 +96,8 @@ def fit(self, df: pd.DataFrame) -> "_SingleDifferencingTransform": | |||
|
|||
self._train_init_dict[current_segment] = cur_series[: self.period] | |||
self._test_init_df = fit_df.iloc[-self.period :, :] | |||
# make multiindex levels consistent | |||
self._test_init_df.columns = self._test_init_df.columns.remove_unused_levels() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use remove_unused_levels
?
Is it the root cause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a solution to the problem. After creation of fit_df
values for old columns remains in MultiIndex
and it leads to errors during set_names
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
IMPORTANT: Please do not create a Pull Request without creating an issue first.
Before submitting (must do checklist)
Type of Change
Proposed Changes
Look #499.
Related Issue
#499.
Closing issues
Closes #499.