@@ -86,6 +86,7 @@ def _build_model(self) -> pd.DataFrame:
8686 model = pm .auto_arima (y = y , X = X_in , ** self .spec .model_kwargs )
8787
8888 fitted_values [target ] = model .predict_in_sample (X = X_in )
89+ print (f"y: { y .head (10 ), y .tail (10 )} " )
8990 actual_values [target ] = y
9091
9192 # Build future dataframe
@@ -107,12 +108,7 @@ def _build_model(self) -> pd.DataFrame:
107108 )
108109 yhat_clean = pd .DataFrame (yhat , index = yhat .index , columns = ["yhat" ])
109110
110- dt_columns [target ] = pd .concat (
111- [
112- df_encoded [self .spec .datetime_column .name ],
113- pd .Series (yhat_clean .index ),
114- ]
115- )
111+ dt_columns [target ] = (df_encoded [self .spec .datetime_column .name ],)
116112 conf_int_clean = pd .DataFrame (
117113 conf_int , index = yhat .index , columns = ["yhat_lower" , "yhat_upper" ]
118114 )
@@ -137,10 +133,14 @@ def _build_model(self) -> pd.DataFrame:
137133 yhat_upper_name = ForecastOutputColumns .UPPER_BOUND
138134 yhat_lower_name = ForecastOutputColumns .LOWER_BOUND
139135 for cat in self .categories :
136+ print (f"cat: { cat } " )
140137 output_i = pd .DataFrame ()
141138 output_i ["Date" ] = dt_columns [f"{ col } _{ cat } " ]
142139 output_i = output_i .set_index ("Date" )
143140 output_i ["Series" ] = cat
141+ print (f"output_i: { output_i } " )
142+ print (f"actual_values: { actual_values [f'{ col } _{ cat } ' ]} " )
143+
144144 output_i ["input_value" ] = actual_values [f"{ col } _{ cat } " ]
145145
146146 output_i ["fitted_value" ] = fitted_values [f"{ col } _{ cat } " ]
0 commit comments