in neural/visuals.py [0:0]
def plot_score(scores, labels, ref=None, path=None, title=None):
"""
input:
-- scores : list of scores arrays of shape (S,)
-- labels: list of labels of same len as scores
"""
n_models = len(scores)
bps = [] # list of boxplots
for idx in range(n_models):
# current elements
score = scores[idx]
if ref is not None:
score = ref - score
bp = plt.boxplot(score, positions=[idx])
bps.append(bp)
plt.xlim(-0.5, n_models + 1)
plt.legend([bp["boxes"][0] for bp in bps], [label for label in labels], loc='upper right')
if title is not None:
plt.title(title)
else:
plt.title("Temporal Correlation between predicted and truth")
plt.tight_layout()
if path is not None:
plt.savefig(os.path.join(path, "scores.png"))