Skip to content

Commit 3ecdc97

Browse files
authored
Merge pull request #19 from sintel-dev/prompter
Mistral&gpt-prompter
2 parents 3619e9c + 1b07add commit 3ecdc97

21 files changed

+3129
-417
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"primitives": [
3+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate",
4+
"sklearn.impute.SimpleImputer",
5+
"sigllm.primitives.transformation.Float2Scalar",
6+
"sigllm.primitives.prompting.timeseries_preprocessing.rolling_window_sequences",
7+
"sigllm.primitives.transformation.format_as_string",
8+
"sigllm.primitives.prompting.gpt.GPT",
9+
"sigllm.primitives.transformation.format_as_integer",
10+
"sigllm.primitives.prompting.anomalies.val2idx",
11+
"sigllm.primitives.prompting.anomalies.find_anomalies_in_windows",
12+
"sigllm.primitives.prompting.anomalies.merge_anomalous_sequences",
13+
"sigllm.primitives.prompting.anomalies.format_anomalies"
14+
],
15+
"init_params": {
16+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
17+
"time_column": "timestamp",
18+
"interval": 21600,
19+
"method": "mean"
20+
},
21+
"sigllm.primitives.transformation.Float2Scalar#1": {
22+
"decimal": 2,
23+
"rescale": true
24+
},
25+
"sigllm.primitives.prompting.timeseries_preprocessing.rolling_window_sequences#1": {
26+
"window_size": 200,
27+
"step_size": 40
28+
},
29+
"sigllm.primitives.transformation.format_as_string#1": {
30+
"space": true
31+
},
32+
"sigllm.primitives.prompting.gpt.GPT#1": {
33+
"name": "gpt-3.5-turbo",
34+
"samples": 10
35+
},
36+
"sigllm.primitives.prompting.anomalies.find_anomalies_in_windows#1": {
37+
"alpha": 0.4
38+
},
39+
"sigllm.primitives.prompting.anomalies.merge_anomalous_sequences#1": {
40+
"beta": 0.5
41+
}
42+
},
43+
"input_names": {
44+
"sigllm.primitives.prompting.gpt.GPT#1": {
45+
"X": "X_str"
46+
},
47+
"sigllm.primitives.transformation.format_as_integer#1":{
48+
"X": "y_hat"
49+
}
50+
},
51+
"output_names": {
52+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
53+
"index": "timestamp"
54+
},
55+
"sigllm.primitives.transformation.format_as_string#1": {
56+
"X": "X_str"
57+
},
58+
"sigllm.primitives.prompting.gpt.GPT#1": {
59+
"y": "y_hat"
60+
},
61+
"sigllm.primitives.transformation.format_as_integer#1":{
62+
"X": "y"
63+
}
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"primitives": [
3+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate",
4+
"sklearn.impute.SimpleImputer",
5+
"sigllm.primitives.transformation.Float2Scalar",
6+
"sigllm.primitives.prompting.timeseries_preprocessing.rolling_window_sequences",
7+
"sigllm.primitives.transformation.format_as_string",
8+
"sigllm.primitives.prompting.huggingface.HF",
9+
"sigllm.primitives.transformation.format_as_integer",
10+
"sigllm.primitives.prompting.anomalies.val2idx",
11+
"sigllm.primitives.prompting.anomalies.find_anomalies_in_windows",
12+
"sigllm.primitives.prompting.anomalies.merge_anomalous_sequences",
13+
"sigllm.primitives.prompting.anomalies.format_anomalies"
14+
],
15+
"init_params": {
16+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
17+
"time_column": "timestamp",
18+
"interval": 21600,
19+
"method": "mean"
20+
},
21+
"sigllm.primitives.transformation.Float2Scalar#1": {
22+
"decimal": 2,
23+
"rescale": true
24+
},
25+
"sigllm.primitives.prompting.timeseries_preprocessing.rolling_window_sequences#1": {
26+
"window_size": 200,
27+
"step_size": 40
28+
},
29+
"sigllm.primitives.transformation.format_as_string#1": {
30+
"space": false
31+
},
32+
"sigllm.primitives.prompting.huggingface.HF#1": {
33+
"name": "mistralai/Mistral-7B-Instruct-v0.2",
34+
"samples": 10
35+
},
36+
"sigllm.primitives.prompting.anomalies.find_anomalies_in_windows#1": {
37+
"alpha": 0.4
38+
},
39+
"sigllm.primitives.prompting.anomalies.merge_anomalous_sequences#1": {
40+
"beta": 0.5
41+
}
42+
},
43+
"input_names": {
44+
"sigllm.primitives.prompting.huggingface.HF#1": {
45+
"X": "X_str"
46+
},
47+
"sigllm.primitives.transformation.format_as_integer#1":{
48+
"X": "y_hat"
49+
}
50+
},
51+
"output_names": {
52+
"mlstars.custom.timeseries_preprocessing.time_segments_aggregate#1": {
53+
"index": "timestamp"
54+
},
55+
"sigllm.primitives.transformation.format_as_string#1": {
56+
"X": "X_str"
57+
},
58+
"sigllm.primitives.prompting.huggingface.HF#1": {
59+
"y": "y_hat"
60+
},
61+
"sigllm.primitives.transformation.format_as_integer#1":{
62+
"X": "y"
63+
}
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "sigllm.primitives.prompting.anomalies.find_anomalies_in_windows",
3+
"contributors": [
4+
"Sarah Alnegheimish <[email protected]>",
5+
"Linh Nguyen <[email protected]>"
6+
],
7+
"description": "Get the final list of anomalous indices of each window",
8+
"classifiers": {
9+
"type": "postprocessor",
10+
"subtype": "merger"
11+
},
12+
"modalities": [],
13+
"primitive": "sigllm.primitives.prompting.anomalies.find_anomalies_in_windows",
14+
"produce": {
15+
"args": [
16+
{
17+
"name": "y",
18+
"type": "ndarray"
19+
}
20+
],
21+
"output": [
22+
{
23+
"name": "y",
24+
"type": "ndarray"
25+
}
26+
]
27+
},
28+
"hyperparameters": {
29+
"fixed": {
30+
"alpha": {
31+
"type": "float",
32+
"default": 0.5
33+
}
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "sigllm.primitives.prompting.anomalies.format_anomalies",
3+
"contributors": [
4+
"Sarah Alnegheimish <[email protected]>",
5+
"Linh Nguyen <[email protected]>"
6+
],
7+
"description": "Convert list of indices to list of intervals by padding to both sides and merge overlapping",
8+
"classifiers": {
9+
"type": "postprocessor",
10+
"subtype": "converter"
11+
},
12+
"modalities": [],
13+
"primitive": "sigllm.primitives.prompting.anomalies.format_anomalies",
14+
"produce": {
15+
"args": [
16+
{
17+
"name": "y",
18+
"type": "ndarray"
19+
},
20+
{
21+
"name": "timestamp",
22+
"type": "ndarray"
23+
}
24+
],
25+
"output": [
26+
{
27+
"name": "anomalies",
28+
"type": "List"
29+
}
30+
]
31+
},
32+
"hyperparameters": {
33+
"fixed": {
34+
"padding_size": {
35+
"type": "int",
36+
"default": 50
37+
}
38+
}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "sigllm.primitives.prompting.anomalies.merge_anomalous_sequences",
3+
"contributors": [
4+
"Sarah Alnegheimish <[email protected]>",
5+
"Linh Nguyen <[email protected]>"
6+
],
7+
"description": "Get the final list of anomalous indices of a sequence when merging all rolling windows",
8+
"classifiers": {
9+
"type": "postprocessor",
10+
"subtype": "merger"
11+
},
12+
"modalities": [],
13+
"primitive": "sigllm.primitives.prompting.anomalies.merge_anomalous_sequences",
14+
"produce": {
15+
"args": [
16+
{
17+
"name": "y",
18+
"type": "ndarray"
19+
},
20+
{
21+
"name": "first_index",
22+
"type": "ndarray"
23+
},
24+
{
25+
"name": "window_size",
26+
"type": "int"
27+
},
28+
{
29+
"name": "step_size",
30+
"type": "int"
31+
}
32+
],
33+
"output": [
34+
{
35+
"name": "y",
36+
"type": "ndarray"
37+
}
38+
]
39+
},
40+
"hyperparameters": {
41+
"fixed": {
42+
"beta": {
43+
"type": "float",
44+
"default": 0.5
45+
}
46+
}
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "sigllm.primitives.prompting.anomalies.val2idx",
3+
"contributors": [
4+
"Sarah Alnegheimish <[email protected]>",
5+
"Linh Nguyen <[email protected]>"
6+
],
7+
"description": "Convert detected anomalous values into indices",
8+
"classifiers": {
9+
"type": "postprocessor",
10+
"subtype": "converter"
11+
},
12+
"modalities": [],
13+
"primitive": "sigllm.primitives.prompting.anomalies.val2idx",
14+
"produce": {
15+
"args": [
16+
{
17+
"name": "y",
18+
"type": "ndarray"
19+
},
20+
{
21+
"name": "X",
22+
"type": "ndarray"
23+
}
24+
],
25+
"output": [
26+
{
27+
"name": "y",
28+
"type": "ndarray"
29+
}
30+
]
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"name": "sigllm.primitives.prompting.gpt.GPT",
3+
"contributors": [
4+
"Linh Nguyen <[email protected]>"
5+
],
6+
"description": "Prompt openai GPT model to detect time series anomalies.",
7+
"classifiers": {
8+
"type": "estimator",
9+
"subtype": "detector"
10+
},
11+
"modalities": [],
12+
"primitive": "sigllm.primitives.prompting.gpt.GPT",
13+
"produce": {
14+
"method": "detect",
15+
"args": [
16+
{
17+
"name": "X",
18+
"type": "ndarray"
19+
}
20+
],
21+
"output": [
22+
{
23+
"name": "y",
24+
"type": "ndarray"
25+
},
26+
{
27+
"name": "logprob",
28+
"type": "ndarray",
29+
"default": null
30+
}
31+
]
32+
},
33+
"hyperparameters": {
34+
"fixed": {
35+
"name": {
36+
"type": "str",
37+
"default": "gpt-3.5-turbo"
38+
},
39+
"sep": {
40+
"type": "str",
41+
"default": ","
42+
},
43+
"anomalous_percent": {
44+
"type": "float",
45+
"default": "0.5"
46+
},
47+
"temp": {
48+
"type": "float",
49+
"default": 1
50+
},
51+
"top_p": {
52+
"type": "float",
53+
"default": 1
54+
},
55+
"logprobs": {
56+
"type": "bool",
57+
"default": false
58+
},
59+
"top_logprobs": {
60+
"type": "int",
61+
"default": null
62+
},
63+
"samples": {
64+
"type": "int",
65+
"default": 1
66+
},
67+
"seed": {
68+
"type": "int",
69+
"default": null
70+
}
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)