-
Notifications
You must be signed in to change notification settings - Fork 3
/
Exp_feature_selection_feature_number.py
59 lines (53 loc) · 1.97 KB
/
Exp_feature_selection_feature_number.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
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# df = pd.DataFrame(np.random.rand(6,4),
# index=['one', 'two', 'three', 'four', 'five', 'six'],
# columns=pd.Index(['A', 'B', 'C', 'D'], name='Genus'))
# df.plot(kind='bar')
indexs = ['17-AAG', 'AEW541', 'AZD0530', 'AZD6244', 'Erlotinib', 'Irinotecan', 'L-685458',
'Lapatinib', 'LBW242', 'Nilotinib', 'Nutlin-3', 'Paclitaxel', 'Panobinostat', 'PD-0325901',
'PD-0332991', 'PF2341066', 'PHA-665752', 'PLX4720', 'RAF265', 'Sorafenib', 'TAE684', 'TKI258',
'Topotecan', 'ZD-6474']
data = pd.read_csv('data/feature_select_numbers.csv')
data.set_index('feature_numbers', inplace=True, drop=True)
print(data)
# data.plot(kind='line')
x = data.index
y1 = data['17-AAG']
y2 = data['AEW541']
y3 = data['AZD0530']
y4 = data['AZD6244']
# plt.subplot(411)
plt.plot(x, y1, color='b', linewidth=2, label='17-AAG' , ls='-.', marker='+', ms=10)
plt.legend(loc="lower right", fontsize=16)
plt.yticks(fontsize=14)
plt.xticks(fontsize=14)
plt.grid(True)
# plt.subplot(412)
plt.plot(x, y2, color='r', linewidth=2, label='AEW541', ls=':', marker='^', ms=10)
plt.legend(loc="lower right", fontsize=16)
plt.yticks(fontsize=14)
plt.xticks(fontsize=14)
plt.grid(True)
plt.ylabel('Accuracy Rate', fontsize=16)
# plt.subplot(413)
plt.plot(x, y3, color='g', linewidth=2, label='AZD0530', ls='-', marker='*', ms=10)
plt.legend(loc="lower right", fontsize=16)
plt.yticks(fontsize=14)
plt.xticks(fontsize=14)
plt.grid(True)
plt.ylabel('SVM Model', fontsize=16)
# plt.subplot(414)
plt.plot(x, y4, color='orange', linewidth=2, label='AZD6244', ls='--', marker='o', ms=10)
# plt.subplot(221)
plt.legend(loc="lower right", fontsize=16)
plt.yticks(fontsize=14)
plt.xticks(fontsize=14)
# 设置坐标轴名称
plt.xlabel('feature numbers', fontsize=18)
plt.ylabel('SVM Model Accuracy Rate', fontsize=16)
plt.grid(True)
# plt.xticks(rotation=45)
# plt.savefig('image/feature_select_experiment.png')
plt.show()