a b/python/run_train_SVM.py
1
#!/usr/bin/env python
2
3
"""
4
run_SVM.py
5
    
6
VARPA, University of Coruna
7
Mondejar Guerra, Victor M.
8
27 Oct 2017
9
"""
10
11
from train_SVM import *
12
13
# Call different configurations for train_SVM.py 
14
15
####################################################################################
16
winL = 90
17
winR = 90
18
do_preprocess = True
19
use_weight_class = True
20
maxRR = True
21
compute_morph = {''} # 'wvlt', 'HOS', 'myMorph'
22
23
multi_mode = 'ovo'
24
voting_strategy = 'ovo_voting'  # 'ovo_voting_exp', 'ovo_voting_both'
25
26
use_RR = False
27
norm_RR = False
28
29
oversamp_method = ''
30
feature_selection = ''
31
do_cross_val = ''
32
C_value = 0.001
33
reduced_DS = False # To select only patients in common with MLII and V1
34
leads_flag = [1,0] # MLII, V1
35
36
pca_k = 0
37
38
################
39
40
# With feature selection
41
ov_methods = {''}#, 'SMOTE_regular'}
42
43
C_values = {0.001, 0.01, 0.1, 1, 10, 100}
44
gamma_values = {0.0}
45
gamma_value = 0.0
46
47
for C_value in C_values:
48
    pca_k = 0
49
50
    # Single
51
    use_RR = False
52
    norm_RR = False
53
    compute_morph = {'u-lbp'} 
54
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
55
            
56
    """
57
    # Two
58
    use_RR = True
59
    norm_RR = True
60
    compute_morph = {'u-lbp'} 
61
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
62
    use_RR = False
63
    norm_RR = False
64
65
    compute_morph = {'wvlt', 'u-lbp'} 
66
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
67
            
68
    compute_morph = {'HOS', 'u-lbp'} 
69
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
70
71
    compute_morph = {'myMorph', 'u-lbp'} 
72
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
73
             
74
75
76
    # Three
77
    use_RR = True
78
    norm_RR = True
79
    compute_morph = {'wvlt', 'u-lbp'} 
80
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
81
            
82
    compute_morph = {'HOS', 'u-lbp'} 
83
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
84
85
    compute_morph = {'myMorph', 'u-lbp'} 
86
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
87
     
88
    use_RR = False
89
    norm_RR = False
90
    compute_morph = {'wvlt','HOS', 'u-lbp'} 
91
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
92
            
93
    compute_morph = {'wvlt','myMorph', 'u-lbp'} 
94
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
95
     
96
97
    compute_morph = {'HOS','myMorph', 'u-lbp'} 
98
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
99
     
100
101
102
    # four
103
    use_RR = True
104
    norm_RR = True
105
    compute_morph = {'wvlt', 'HOS', 'u-lbp'} 
106
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
107
108
    compute_morph = {'wvlt', 'myMorph', 'u-lbp'} 
109
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
110
     
111
112
    compute_morph = {'HOS','myMorph', 'u-lbp'} 
113
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
114
     
115
    use_RR = False
116
    norm_RR = False
117
    compute_morph = {'wvlt', 'HOS','myMorph', 'u-lbp'} 
118
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
119
     
120
121
122
    # five
123
    use_RR = True
124
    norm_RR = True
125
    compute_morph = {'wvlt', 'HOS','myMorph', 'u-lbp'} 
126
    main(multi_mode, 90, 90, do_preprocess, use_weight_class, maxRR, use_RR, norm_RR, compute_morph, oversamp_method, pca_k, feature_selection, do_cross_val, C_value, gamma_value, reduced_DS, leads_flag)
127
             
128
    """