-
Notifications
You must be signed in to change notification settings - Fork 1
/
plot_FArate.py
105 lines (98 loc) · 3.94 KB
/
plot_FArate.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import matplotlib.pyplot as plt
# Define the data for each stage
stage_data_11 = [
{
'n_values': [1, 2, 3, 4, 5],
'fa_values': [1, 1, 1, 0.7125, 0.315625],
'title': 'Stage 0'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7],
'fa_values': [1, 1, 1, 0.748438, 0.723437, 0.728125, 0.392188],
'title': 'Stage 1'
},
{
'n_values': [1, 2, 3, 4, 5],
'fa_values': [1, 1, 1, 0.60625, 0.470313],
'title': 'Stage 2'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'fa_values': [1, 1, 1, 1, 0.7625, 0.726562, 0.620313, 0.564062, 0.534375, 0.296875],
'title': 'Stage 3'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
'fa_values': [1, 1, 1, 1, 1, 0.823438, 0.915625, 0.696875, 0.529688, 0.415625],
'title': 'Stage 4'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
'fa_values': [1, 1, 0.803125, 0.81875, 0.785937, 0.770312, 0.660937, 0.654688, 0.660937, 0.6, 0.39375],
'title': 'Stage 5'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
'fa_values': [1, 1, 1, 0.84375, 0.796875, 0.8125, 0.846875, 0.701563, 0.651563, 0.64375, 0.607813, 0.545313, 0.496875],
'title': 'Stage 6'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
'fa_values': [1, 1, 1, 1, 1, 0.703125, 0.798437, 0.770312, 0.565625, 0.503125, 0.523438, 0.504687, 0.320312],
'title': 'Stage 7'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15],
'fa_values': [1, 1, 1, 1, 1, 0.898438, 0.91875, 0.775, 0.589063, 0.567187, 0.560938, 0.551562, 0.509375, 0.415625],
'title': 'Stage 8'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
'fa_values': [1, 1, 0.904688, 0.875, 0.904688, 0.784375, 0.85, 0.765625, 0.773438, 0.532812, 0.59375, 0.546875, 0.554688, 0.426562],
'title': 'Stage 9'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
'fa_values': [1, 1, 1, 1, 0.926562, 0.945312, 0.946875, 0.8375, 0.784375, 0.807813, 0.76875, 0.795313, 0.732813, 0.678125, 0.589063, 0.448438],
'title': 'Stage 10'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
'fa_values': [1, 1, 1, 0.925, 0.853125, 0.80625, 0.790625, 0.7875, 0.789062, 0.70625, 0.6625, 0.601562, 0.601562, 0.54375, 0.551562, 0.492188],
'title': 'Stage 11'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
'fa_values': [1, 1, 1, 0.978125, 0.953125, 0.9375, 0.951563, 0.898438, 0.85625, 0.773438, 0.70625, 0.70625, 0.757812, 0.670313, 0.714063, 0.646875, 0.520312, 0.495313],
'title': 'Stage 12'
}
]
stage_data =[
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18],
'fa_values': [1, 1, 1, 0.978125, 0.953125, 0.9375, 0.951563, 0.898438, 0.85625, 0.773438, 0.70625, 0.70625, 0.757812, 0.670313, 0.714063, 0.646875, 0.520312, 0.495313],
'title': '1:1 Pos:Neg Ratio'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
'fa_values': [1, 1, 1, 1, 1, 0.805469, 0.834375, 0.849219, 0.796094, 0.742188, 0.661719, 0.688281, 0.603906, 0.589063, 0.475781],
'title': '1:2 Pos:Neg Ratio'
},
{
'n_values': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
'fa_values': [1, 1, 1, 1, 1, 0.882353, 0.908824, 0.923529, 0.735294, 0.729412, 0.773529, 0.647059, 0.597059, 0.6, 0.538235, 0.467647],
'title': '2:1 Pos:Neg Ratio'
}
]
# Create a figure and axis object
fig, ax = plt.subplots()
# Plot each stage's FA as a line
for stage in stage_data:
ax.plot(stage['n_values'], stage['fa_values'], label=f"{stage['title']}")
# Set the xand y axis labels
ax.set_xlabel('Tree Depth')
ax.set_ylabel('False Alarm Rate')
# Add a legend
ax.legend()
# Show the plot
plt.show()