def _predict_fitted_time_series(self) -> Dict[str, pd.DataFrame]: prediction_dictionary = {} if self.level == 0: prediction_dictionary = super()._predict_fitted_time_series() elif self.level == max(list(self.level_nodes.keys())): prediction_dictionary = HierarchicalBottomUp._predict_fitted_time_series( self) else: self._predict_time_series_top_down(prediction_dictionary) self._predict_fitted_time_series_bottom_up(prediction_dictionary) return prediction_dictionary
def _predict_new_time_series(self, X: pd.DataFrame) -> Dict[str, pd.DataFrame]: new_time_series_dictionary = {} if self.level == 0: new_time_series_dictionary = HierarchicalTopDown._predict_new_time_series( self, X) elif self.level == max(list(self.level_nodes.keys())): new_time_series_dictionary = HierarchicalBottomUp._predict_new_time_series( self, X) else: self._predict_time_series_top_down(new_time_series_dictionary, X) self._predict_new_time_series_bottom_up(new_time_series_dictionary, X) return new_time_series_dictionary
def test_constructor(self, time_series_forecasting_model1_no_cache, dataframes): tree = tree_construction(dataframes) HierarchicalBottomUp(time_series_forecasting_model1_no_cache, tree)
def test_basic_constructor(self, time_series_forecasting_model1_no_cache): HierarchicalBottomUp(model=time_series_forecasting_model1_no_cache, hierarchy_tree='infer')
def hierarchical_basic_bottom_up_model( time_series_forecasting_model1_no_cache): return HierarchicalBottomUp(time_series_forecasting_model1_no_cache, 'infer')
def hierarchical_bottom_up_model(draw, time_series_forecasting_model1_no_cache): dataframes = draw(n_time_series_with_same_index(min_n=5)) tree = draw(tree_construction(dataframes)) return HierarchicalBottomUp(time_series_forecasting_model1_no_cache, tree)