main
Eliza Moscovskaya 2 weeks ago
commit 9321f1973d

@ -50,7 +50,8 @@ def total_boxplot(DATA, creator = 'any', tester = 'any', simulation = "dummy_sim
#print(len(data_to_plot), len(labels))
elements = ax.boxplot(data_to_plot, patch_artist=True, tick_labels=labels)
median_styling = {'color': 'black', 'linewidth': 2}
elements = ax.boxplot(data_to_plot, patch_artist=True, tick_labels=labels, medianprops=median_styling)
for i, patch in enumerate(elements['boxes']):
patch.set_facecolor(colors_list[(i)%10])
@ -101,6 +102,7 @@ def heat_map(DATA, criteria = np.median, savepath = "./"):
ax.figure.savefig(f"{savepath}/cross_validation_{criteria.__name__}.png")
def convert_score(data):
score = data['score']
@ -119,6 +121,55 @@ def convert_score(data):
return score_new
# DATA[name] = {name: [scores]}
def no_interface_plot(DATA, savepath = "./"):
n = 0
names_with = []#DATA.keys()
names_without = []
for creator, Data in DATA.items():
for tester, data in Data.items():
if tester == creator:
if 'NoInt' in creator:
pass
else:
wInt = creator+'NoInt'
if wInt in DATA:
names_with.append(creator)
names_without.append(wInt)
#print(len(names_with), names_with)
#print(len(names_without), names_without)
'''
for tester, data in Data.items():
if tester == creator:
del DATA[]
'''
creator_means = {
'With interface': [np.median(DATA[name][name]) for name in names_with],
'Without interface': [np.median(DATA[name][name]) for name in names_without]}
x = np.arange(len(names_with)) # the label locations
width = 0.25 # the width of the bars
multiplier = 0
fig, ax = plt.subplots(layout='constrained')
for attribute, measurement in creator_means.items():
offset = width * multiplier
rects = ax.bar(x + offset, np.round(measurement,2), width, label=attribute)
ax.bar_label(rects, padding=3)
multiplier += 1
ax.set_ylabel('Score')
ax.set_title('Change in scores with visual interface disabled')
ax.set_xticks(x + width, names_with)
ax.legend(loc='upper left', ncols=3)
ax.set_ylim(0, 100)
ax.grid(axis='y')
ax.figure.savefig(f"{savepath}/no_interface.png")
if __name__ == '__main__':
global_path = "/home/gestures6/Easy_sim/dummy_simulation/stats/"
@ -157,12 +208,14 @@ if __name__ == '__main__':
savepath = global_path
total_boxplot(DATA, creator = 'any', tester = 'any', savepath = savepath)
for name in DATA.keys():
no_interface_plot(DATA, savepath = savepath)
#for name in DATA.keys():
#total_boxplot(DATA, creator = name, tester = 'any', savepath = savepath)
#total_boxplot(DATA, creator = 'any', tester = name, savepath = savepath)
total_boxplot(DATA, creator = name, tester = 'any', savepath = savepath)
total_boxplot(DATA, creator = 'any', tester = name, savepath = savepath)
#heat_map(DATA, savepath = savepath)
heat_map(DATA, savepath = savepath)
plt.show()

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Loading…
Cancel
Save