File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
ads/opctl/operator/lowcode/anomaly/model Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import numpy as np
9
9
import pandas as pd
10
+ from merlion .post_process .threshold import AggregateAlarms
10
11
from merlion .utils import TimeSeries
11
12
12
13
from ads .common .decorator .runtime_dependency import runtime_dependency
@@ -83,7 +84,16 @@ def _build_model(self) -> AnomalyOutput:
83
84
data = df .set_index (date_column )
84
85
data = TimeSeries .from_pd (data )
85
86
for model_name , (model_config , model ) in model_config_map .items ():
86
- model_config = model_config (** self .spec .model_kwargs )
87
+ model_config = model_config (
88
+ ** {
89
+ ** self .spec .model_kwargs ,
90
+ "threshold" : AggregateAlarms (
91
+ alm_threshold = model_kwargs .get ("alm_threshold" )
92
+ if model_kwargs .get ("alm_threshold" )
93
+ else None
94
+ ),
95
+ }
96
+ )
87
97
if hasattr (model_config , "target_seq_index" ):
88
98
model_config .target_seq_index = df .columns .get_loc (
89
99
self .spec .target_column
You can’t perform that action at this time.
0 commit comments