File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
ads/opctl/operator/lowcode/forecast/model Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ def _build_model(self) -> pd.DataFrame:
176176 output_col = pd .DataFrame ()
177177 yhat_upper_name = ForecastOutputColumns .UPPER_BOUND
178178 yhat_lower_name = ForecastOutputColumns .LOWER_BOUND
179+ hist_df = model .back_forecast ().forecast
179180
180181 for cat in self .categories :
181182 output_i = pd .DataFrame ()
@@ -194,6 +195,10 @@ def _build_model(self) -> pd.DataFrame:
194195 output_i ["forecast_value" ] = self .prediction .forecast [[cat_target ]]
195196 output_i [yhat_upper_name ] = self .prediction .upper_forecast [[cat_target ]]
196197 output_i [yhat_lower_name ] = self .prediction .lower_forecast [[cat_target ]]
198+ output_i .iloc [
199+ - hist_df .shape [0 ] - self .spec .horizon : - self .spec .horizon ,
200+ output_i .columns .get_loc (f"fitted_value" ),
201+ ] = hist_df [cat_target ]
197202
198203 output_i = output_i .reset_index ()
199204 output_col = pd .concat ([output_col , output_i ])
You can’t perform that action at this time.
0 commit comments