-
Notifications
You must be signed in to change notification settings - Fork 12
/
run_ml_on_selected_bandwidth.sh
executable file
·55 lines (46 loc) · 2.32 KB
/
run_ml_on_selected_bandwidth.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
49
50
51
52
53
54
55
#!/bin/bash
path_lists=$1
path_models=$2
path_acc=$3
## the following script recompute the classification of the testing dataset
# using the pretrained models, available in the repo
# "pretrained_models". The directorie containing the models and the
# one containing projected (LDA) data must be given as parameters of the
# current script
# list of the scenario
declare -a tagmaps=('executable_classification'
'family_classification'
'novelty_classification'
'obfuscation_classification'
'packer_identification'
'type_classification'
'virtualization_identification')
declare -a NB_bds=('28' '28' '28' '10' '16' '24' '6')
declare -a SVM_bds=('20' '28' '28' '10' '16' '24' '6')
# number of tagmaps
nb_of_tagmaps=${#tagmaps[@]}
for (( i=0; i<${nb_of_tagmaps}; i++ ));
do
echo "Computing LDA + NB, tagmap: ${tagmaps[$i]}"
python3 ml_analysis/NB.py --lists ${path_lists}/files_lists_tagmaps=${tagmaps[$i]}.npy\
--log-file ml_analysis/log-evaluation_selected_bandwidth.txt\
--acc ${path_acc}\
--time_limit 0.5\
--mean_size None\
--model_nb ${path_models}/NB/NB_tagmaps=${tagmaps[$i]}_${NB_bds[$i]}bd.jl\
--model_lda ${path_models}/LDA/transformed_traces/transformed_traces_tagmaps=${tagmaps[$i]}_${NB_bds[$i]}bd.npy
# --model_lda ${path_models}/LDA/LDA_tagmaps=${tagmaps[$i]}_${NB_bds[$i]}bd.jl\
echo "Computing LDA + SVM, tagmap: ${tagmaps[$i]}"
python3 ml_analysis/SVM.py --lists ${path_lists}/files_lists_tagmaps=${tagmaps[$i]}.npy\
--log-file ml_analysis/log-evaluation_selected_bandwidth.txt\
--acc ${path_acc}\
--time_limit 0.5\
--mean_size None\
--model_svm ${path_models}/SVM/SVM_tagmaps=${tagmaps[$i]}_${SVM_bds[$i]}bd.jl\
--model_lda ${path_models}/LDA/transformed_traces/transformed_traces_tagmaps=${tagmaps[$i]}_${SVM_bds[$i]}bd.npy
# --model_lda ${path_models}/LDA/LDA_tagmaps=${tagmaps[$i]}_${SVM_bds[$i]}bd.jl\
done
################################################################################
## display the results
# a figure (pop'up) and a tabular (in the terminal)
python3 ml_analysis/read_logs.py --path ml_analysis/log-evaluation_selected_bandwidth.txt