-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanomaly_detection.sh
executable file
·48 lines (40 loc) · 1.44 KB
/
anomaly_detection.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
mkdir -p evaluation_ad
run_anomaly_detection() {
local method=$1
local dataset=$2
local penalty=$3
local simple_flag=$4
if [ -z "$penalty" ]; then
if [ "$simple_flag" == "simple" ]; then
file_path="./evaluation_ad/${method}_${dataset}_simple.txt"
else
file_path="./evaluation_ad/${method}_${dataset}_full.txt"
fi
else
if [ "$simple_flag" == "simple" ]; then
file_path="./evaluation_ad/${method}_${penalty}_${dataset}_simple.txt"
else
file_path="./evaluation_ad/${method}_${penalty}_${dataset}_full.txt"
fi
fi
if [ -f "$file_path" ]; then
echo "$file_path already exists, skipping."
else
if [ -z "$penalty" ]; then
python anomaly_detection.py --method $method --dataset $dataset $([ "$simple_flag" == "simple" ] && echo "--simple") > "$file_path"
else
python anomaly_detection.py --method $method --penalty $penalty --dataset $dataset $([ "$simple_flag" == "simple" ] && echo "--simple") > "$file_path"
fi
fi
}
echo "N-Sigma"
for dataset in sock-shop online-boutique train-ticket; do
run_anomaly_detection nsigma $dataset "" simple
run_anomaly_detection nsigma $dataset "" full
done
echo "BOCPD"
for dataset in sock-shop online-boutique train-ticket; do
run_anomaly_detection bocpd $dataset "" simple
run_anomaly_detection bocpd $dataset "" full
done