@@ -86,8 +86,8 @@ def _build_model(self) -> pd.DataFrame:
86
86
model = pm .auto_arima (y = y , X = X_in , ** self .spec .model_kwargs )
87
87
88
88
fitted_values [target ] = model .predict_in_sample (X = X_in )
89
- print (f"y: { y .head (10 ), y .tail (10 )} " )
90
89
actual_values [target ] = y
90
+ actual_values [target ].index = pd .to_datetime (y .index )
91
91
92
92
# Build future dataframe
93
93
start_date = y .index .values [- 1 ]
@@ -108,7 +108,7 @@ def _build_model(self) -> pd.DataFrame:
108
108
)
109
109
yhat_clean = pd .DataFrame (yhat , index = yhat .index , columns = ["yhat" ])
110
110
111
- dt_columns [target ] = ( df_encoded [self .spec .datetime_column .name ],)
111
+ dt_columns [target ] = df_encoded [self .spec .datetime_column .name ]
112
112
conf_int_clean = pd .DataFrame (
113
113
conf_int , index = yhat .index , columns = ["yhat_lower" , "yhat_upper" ]
114
114
)
@@ -133,16 +133,12 @@ def _build_model(self) -> pd.DataFrame:
133
133
yhat_upper_name = ForecastOutputColumns .UPPER_BOUND
134
134
yhat_lower_name = ForecastOutputColumns .LOWER_BOUND
135
135
for cat in self .categories :
136
- print (f"cat: { cat } " )
137
136
output_i = pd .DataFrame ()
138
137
output_i ["Date" ] = dt_columns [f"{ col } _{ cat } " ]
139
- output_i = output_i .set_index ("Date" )
140
138
output_i ["Series" ] = cat
141
- print (f"output_i: { output_i } " )
142
- print (f"actual_values: { actual_values [f'{ col } _{ cat } ' ]} " )
139
+ output_i = output_i .set_index ("Date" )
143
140
144
141
output_i ["input_value" ] = actual_values [f"{ col } _{ cat } " ]
145
-
146
142
output_i ["fitted_value" ] = fitted_values [f"{ col } _{ cat } " ]
147
143
output_i ["forecast_value" ] = outputs [f"{ col } _{ cat } " ]["yhat" ]
148
144
output_i [yhat_upper_name ] = outputs [f"{ col } _{ cat } " ]["yhat_upper" ]
0 commit comments