-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTableFeatureGrade.py
76 lines (63 loc) · 2.53 KB
/
TableFeatureGrade.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import exec
print("\n\n*** DO NOT EXECUTE TWO SCRIPTS ON PARALLEL ***\n\n")
print(" 1) Tier Rank \n 2) Feature Rank")
get_CE = 0 if int(input("Enter choice: ")) == 1 else 1
while(True):
print(" 1) Adult \n 2) Compas \n 3) Crime \n 4) German \n 5) Health 6) Exit")
choice = int(input("Enter choice: "))
data_folder = ""
if(choice == 1):
data_folder = "adult"
reg_params = [1,0.05,0.01] #for linear rbf and poly respectively
gammas = [0.01,0.03,0.05,0.07,0.09]
degrees = [3]
coef0s = list(range(0,16,3))[1:]
abstractions = ['raf']
perturbations = ["top"]
kernel_types = ['linear','rbf','poly']
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE)
if(choice == 2):
data_folder = "compas"
reg_params = [1,0.05,0.01]
gammas = [0.01,0.03,0.05,0.07,0.09]
degrees = [3]
coef0s = list(range(0,16,3))[1:]
abstractions = ['raf']
perturbations = ["top"]
kernel_types = ['linear','rbf','poly']
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE)
if(choice == 3):
data_folder = "crime"
reg_params = [1,1,1]
gammas = [0.01,0.001,0.0001,0.00001]
degrees = [3,9,15,20]
coef0s = [0]
abstractions = ['raf']
perturbations = ["top"]
kernel_types = ['linear','rbf','poly']
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE)
if(choice == 4):
data_folder = "german"
reg_params = [1,10,0.01]
gammas = [0.01,0.03,0.05,0.07,0.09]
degrees = [6]
coef0s = list(range(0,16,3))[1:]
abstractions = ['raf']
perturbations = ["top"]
kernel_types = ['linear','rbf','poly']
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE)
if(choice == 5):
data_folder = "health"
reg_params = [0.01,0.1,0.1]
gammas = [0.01]
degrees = [3]
coef0s = [0.01]
abstractions = ['raf']
perturbations = ["top"]
kernel_types = ['linear','rbf','poly']
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE)
if(choice == 6):
break
print(f"\n\n\n OUTPUT LOCATION: \n" +
f"1) Check ./{data_folder}/{data_folder}-feature_analysis.txt for feature grades" +
"for each SVM. Cummulative feature grades over particular or all kernel at the bottom of the file\n")