-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_graph_compare_algos_multiple.py
64 lines (54 loc) · 2.31 KB
/
generate_graph_compare_algos_multiple.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
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
# Got from experiment es_cross_sources
# Config:
# configs_to_run = [
# Config(algos=["chords_chordino", "melody_melodia"], range_words=[range(2, 8)], search_func=es_search_shingle),
# Config(algos=["chords_chordino", "melody_piptrack"], range_words=[range(2, 8)], search_func=es_search_shingle),
# Config(algos=["chords_crema", "melody_melodia"], range_words=[range(2, 8)], search_func=es_search_shingle),
# Config(algos=["chords_crema", "melody_piptrack"], range_words=[range(2, 8)], search_func=es_search_shingle),
# Config(algos=["chords_chordino", "chords_crema"], range_words=[range(2, 8)], search_func=es_search_shingle),
# Config(algos=["melody_melodia", "melody_piptrack"], range_words=[range(2, 8)], search_func=es_search_shingle),
# ]
labels = ['MT10', 'MT1']
ch_me_means = [0.91, 0.78]
ch_mp_means = [0.88, 0.76]
cr_me_means = [0.86, 0.72]
cr_mp_means = [0.84, 0.68]
ch_cr_means = [0.91, 0.82]
me_mp_means = [0.83, 0.62]
# x = np.arange(len(labels)) # the label locations
x = np.array([0, .5])
width = 0.05 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(x - 2.5*width, ch_cr_means, width, label='ch-cr')
rects2 = ax.bar(x - 1.5*width, ch_me_means, width, label='ch-me')
rects3 = ax.bar(x - width/2, ch_mp_means, width, label='ch-mp')
rects4 = ax.bar(x + width/2, cr_me_means, width, label='cr-me')
rects5 = ax.bar(x + 1.5*width, cr_mp_means, width, label='cr-mp')
rects6 = ax.bar(x + 2.5*width, me_mp_means, width, label='me-mp')
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Score')
ax.set_title('MT10 and MT1 for MIR algorithm combination')
ax.set_xticks(x)
ax.set_xticklabels(labels)
ax.legend()
def autolabel(rects):
"""Attach a text label above each bar in *rects*, displaying its height."""
for rect in rects:
height = rect.get_height()
ax.annotate('{}'.format(height),
xy=(rect.get_x() + rect.get_width() / 2, height),
xytext=(0, 1), # 3 points vertical offset
textcoords="offset points",
ha='center', va='bottom')
autolabel(rects1)
autolabel(rects2)
autolabel(rects3)
autolabel(rects4)
autolabel(rects5)
autolabel(rects6)
fig.tight_layout()
plt.show()
plt.savefig("graph_compare_algos_multiple.png")