-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_exp.py
77 lines (52 loc) · 2.1 KB
/
plot_exp.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
import seaborn as sns
sns.set(style="ticks")
dots = sns.load_dataset("dots")
# Define a palette to ensure that colors will be
# shared across the facets
palette = dict(zip(dots.coherence.unique(),
sns.color_palette("rocket_r", 6)))
data.columns
# Plot the lines on two facets
sns.relplot(x="n_variables", y="Accuracy",
hue="Model",
size_order=[['E_NET', 'GBM', 'INFORMATION_GAIN'],
['ISIS', 'LASSO', 'LR_ACCURACY'],
['RANDOM_FOREST', 'RIDGE']],
# size="choice",
col="Method",
# size_order=["T1", "T2"],
# palette=palette,
height=5, aspect=.75, facet_kws=dict(sharex=False),
kind="line", legend="full", data=data)
plt.show()
# Plot the lines on two facets
sns.relplot(x="time", y="firing_rate",
hue="coherence", size="choice", col="align",
size_order=[['E_NET', 'GBM', 'INFORMATION_GAIN'],
['ISIS', 'LASSO', 'LR_ACCURACY'],
['RANDOM_FOREST', 'RIDGE']],
palette=palette,
height=5, aspect=.75, facet_kws=dict(sharex=False),
kind="line", legend="full", data=dots)
plt.show()
exec(open("Utils.py").read(), globals())
exec(open("Utils_parallel.py").read(), globals())
SEED = 741
njob = 20
# exec(open("015_SPLITTING_DATA.py").read(), globals())
# exec(open("030_VARIABLES_SELECTION.py").read(), globals())
# exec(open("035_UNIVARIATE_VARIABLES_SELECTION.py").read(), globals())
nvars = [200, 240, 220] #np.arange(160, 252, 20) #np.concatenate( ([1], np.arange(10, 51, 10), np.arange(70, 140, 30)) )
methods = ['E_NET']
# predictors = extract_predictors( method, nvar, SEED)
# eff_nvar = len(predictors)
probs_to_check = np.arange(0.1, 0.91, 0.1)
DF = pd.DataFrame()
scheduled_model = 'running_model/'
create_dir( scheduled_model)
for method in methods:
for nvar in nvars:
predictors = extract_predictors(method, nvar, SEED)
eff_nvar = len(predictors)
print method, eff_nvar
exec(open("041_RANDOM_FOREST.py").read(), globals())