Přidat graph/graph.py
This commit is contained in:
parent
7e09a03f7c
commit
79a68a5d4f
31
graph/graph.py
Normal file
31
graph/graph.py
Normal file
@ -0,0 +1,31 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
# Dáta z tabuľky
|
||||
models = ["mT5-small", "mT5-base", "mT5-large", "SlovakT5-base", "SlovakT5-small"]
|
||||
precision = [0.4923, 0.4533, 0.6473, 0.6689, 0.6230]
|
||||
recall = [0.6400, 0.6800, 0.5903, 0.6082, 0.5748]
|
||||
f1_score = [0.5662, 0.5440, 0.6188, 0.6386, 0.5989]
|
||||
|
||||
# Nastavenia grafu
|
||||
x = np.arange(len(models))
|
||||
width = 0.25
|
||||
|
||||
# Vykreslenie
|
||||
fig, ax = plt.subplots(figsize=(10, 6))
|
||||
ax.bar(x - width, precision, width, label='Precision', color='red')
|
||||
ax.bar(x, recall, width, label='Recall', color='blue')
|
||||
ax.bar(x + width, f1_score, width, label='F1-score', color='green')
|
||||
|
||||
# Popisy a štýl
|
||||
ax.set_ylabel('Skóre')
|
||||
ax.set_title('Porovnanie výkonnosti modelov (few-shot learning)')
|
||||
ax.set_xticks(x)
|
||||
ax.set_xticklabels(models, rotation=0, ha='center')
|
||||
ax.set_ylim(0, 1)
|
||||
ax.legend()
|
||||
plt.grid(axis='y', linestyle='--', alpha=0.7)
|
||||
plt.tight_layout()
|
||||
|
||||
# Zobrazenie alebo uloženie
|
||||
plt.show()
|
Loading…
Reference in New Issue
Block a user