Skip to content

Commit 93a3281

Browse files
authored
fix automlx and theta forecaster bug (#1344)
1 parent 9751808 commit 93a3281

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

ads/opctl/operator/lowcode/common/utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,16 @@ def normalize_frequency(freq: str) -> str:
419419
if freq.startswith("W-"):
420420
return "W"
421421

422+
if freq.startswith("YS-"):
423+
# Extract the month part after "YS-" (e.g., "JAN", "FEB", "MAR")
424+
month_anchor = freq[3:]
425+
valid_months = {"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}
426+
427+
if month_anchor in valid_months:
428+
return "Y" # Treat as standard year frequency
429+
else:
430+
return freq
431+
422432
# Handle month start/end frequencies
423433
freq_mapping = {
424434
"MS": "M", # Month Start -> Month End

ads/opctl/operator/lowcode/forecast/model/automlx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ def _build_model(self) -> pd.DataFrame:
185185
self.forecast_output.populate_series_output(
186186
series_id=s_id,
187187
fit_val=fitted_values,
188-
forecast_val=summary_frame[target],
189-
upper_bound=summary_frame[f"{target}_ci_upper"],
190-
lower_bound=summary_frame[f"{target}_ci_lower"],
188+
forecast_val=summary_frame[target].values,
189+
upper_bound=summary_frame[f"{target}_ci_upper"].values,
190+
lower_bound=summary_frame[f"{target}_ci_lower"].values,
191191
)
192192

193193
self.model_parameters[s_id] = {

0 commit comments

Comments
 (0)