Skip to content

Commit faf1684

Browse files
authored
Merge branch 'main' into feature/forecast-auto-select
2 parents a85cc97 + 5fe8c49 commit faf1684

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ads/opctl/operator/lowcode/anomaly/model/base_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ def _fallback_build_model(self):
316316
# Iterate over the full_data_dict items
317317
for target, df in self.datasets.full_data_dict.items():
318318
est = linear_model.SGDOneClassSVM(random_state=42)
319-
est.fit(df[target].values.reshape(-1, 1))
319+
est.fit(df[self.spec.target_column].fillna(0).values.reshape(-1, 1))
320320
y_pred = np.vectorize(self.outlier_map.get)(
321-
est.predict(df[target].values.reshape(-1, 1))
321+
est.predict(df[self.spec.target_column].fillna(0).values.reshape(-1, 1))
322322
)
323-
scores = est.score_samples(df[target].values.reshape(-1, 1))
323+
scores = est.score_samples(df[self.spec.target_column].fillna(0).values.reshape(-1, 1))
324324

325325
anomaly = pd.DataFrame(
326326
{date_column: df[date_column], OutputColumns.ANOMALY_COL: y_pred}

0 commit comments

Comments
 (0)