File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
ads/opctl/operator/lowcode/forecast/model Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -130,14 +130,17 @@ def _build_model(self) -> pd.DataFrame:
130130 additional_regressors = list (
131131 set (full_data_indexed .columns ) - {self .original_target_column }
132132 )
133- future_regressor = full_data_indexed .reset_index ().pivot (
134- index = self .spec .datetime_column .name ,
135- columns = ForecastOutputColumns .SERIES ,
136- values = additional_regressors ,
137- )
138-
139- future_reg = future_regressor [: - self .spec .horizon ]
140- regr_fcst = future_regressor [- self .spec .horizon :]
133+ if len (additional_regressors ) > 1 :
134+ future_regressor = full_data_indexed .reset_index ().pivot (
135+ index = self .spec .datetime_column .name ,
136+ columns = ForecastOutputColumns .SERIES ,
137+ values = additional_regressors ,
138+ )
139+ future_reg = future_regressor [: - self .spec .horizon ]
140+ regr_fcst = future_regressor [- self .spec .horizon :]
141+ else :
142+ future_reg = None
143+ regr_fcst = None
141144
142145 if self .loaded_models is None :
143146 model = model .fit (
Original file line number Diff line number Diff line change 4343 # "UberTLCDataset",
4444 # "WeatherDataset",
4545 # "WineDataset",
46- # "WoolyDataset",
46+ "WoolyDataset" ,
4747]
4848
4949MODELS = [
50- # "arima",
51- # "automlx",
52- # "prophet",
53- # "neuralprophet",
50+ "arima" ,
51+ "automlx" ,
52+ "prophet" ,
53+ "neuralprophet" ,
5454 "autots" ,
5555 # "auto",
5656]
You can’t perform that action at this time.
0 commit comments