-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmlxscoring.py
79 lines (67 loc) · 2.39 KB
/
mlxscoring.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
77
78
79
import exec
print("\n\n*** DO NOT EXECUTE TWO SCRIPTS ON PARALLEL ***\n\n")
get_CE = 0
while(True):
print(" 1) RBF \n 2) Poly \n 3) Linear")
kernel_types = []
ch= int(input("Enter choice: "))
print(" 1) Adult \n 2) Compas \n 3) Crime \n 4) German \n 5) Health 6) Exit")
choice = int(input("Enter choice: "))
if(ch == 1):
kernel_types = ['rbf']
if(ch == 2):
kernel_types = ['poly']
if(ch == 3):
kernel_types = ['linear']
if(choice == 1):
data_folder = "adult"
reg_params = [1,0.05,0.01] #for linear rbf and poly respectively
gammas = [0.01]
degrees = [3]
coef0s = [3]
abstractions = ['raf']
perturbations = []
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE, ifmlx = True)
if(choice == 2):
data_folder = "compas"
reg_params = [1,0.05,0.01]
gammas = [0.03]
degrees = [3]
coef0s = [3]
abstractions = ['raf']
perturbations = []
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE, ifmlx = True)
if(choice == 3):
data_folder = "crime"
reg_params = [1,1,1]
gammas = [0.01]
degrees = [3]
coef0s = [0]
abstractions = ['raf']
perturbations = []
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE, ifmlx = True)
if(choice == 4):
data_folder = "german"
reg_params = [1,10,0.01]
gammas = [0.03]
degrees = [6]
coef0s = [6]
abstractions = ['raf']
perturbations = []
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE, ifmlx = True)
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 = []
exec.caller(data_folder,reg_params,gammas,degrees,coef0s,abstractions,perturbations,kernel_types,regType = 1,get_avg_bool = False,get_CE = get_CE, ifmlx = True)
if(choice == 6):
data_folder = ""
break
if not (data_folder == ""):
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")