Skip to content

Commit 7f8b70d

Browse files
authored
Fixed target removal if all unique values (#916)
2 parents 94a9d8a + f6d7726 commit 7f8b70d

File tree

1 file changed

+3
-1
lines changed
  • ads/opctl/operator/lowcode/forecast/model

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def _train_model(self, i, s_id, df, model_kwargs):
6767
self.forecast_output.init_series_output(series_id=s_id, data_at_series=df)
6868
# If trend is constant, remove constant columns
6969
if "trend" not in model_kwargs or model_kwargs["trend"] == "c":
70-
self.constant_cols[s_id] = df.columns[df.nunique() == 1]
70+
self.constant_cols[s_id] = list(df.columns[df.nunique() == 1])
71+
if target in self.constant_cols[s_id]:
72+
self.constant_cols[s_id].remove(target)
7173
df = df.drop(columns=self.constant_cols[s_id])
7274

7375
# format the dataframe for this target. Dropping NA on target[df] will remove all future data

0 commit comments

Comments
 (0)