Skip to content
Snippets Groups Projects
Commit 24614437 authored by Paul Best's avatar Paul Best
Browse files

better plot scores

parent 062ea49d
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,14 @@ import matplotlib.pyplot as plt
import pandas as pd, numpy as np
from metadata import species
algos = ['praat', 'pyin', 'crepe', 'tcrepe', 'tcrepe_ft', 'tcrepe_ftsp', 'basic', 'pesto']
metrics = ['threshold', 'Recall', 'False alarm', 'Pitch acc', 'Chroma acc']
algos = ['praat', 'tcrepe_ftsp', 'tcrepe_ftoth', 'basic', 'pesto', 'pesto_ft']
metrics = ['Recall', 'False alarm', 'Pitch acc', 'Chroma acc']
drop_noisy_bins = True
drop_noisy_bins = False
drop_noisy_vocs = False
fig, ax = plt.subplots(nrows=len(metrics), figsize=(7, 15), sharex=True, sharey=True)
ax[0].set_ylim(0, 1)
fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(10, 10), sharex=True, sharey=True)
ax[0,0].set_ylim(0, 1)
for i, metric in enumerate(metrics):
ok = pd.DataFrame()
......@@ -17,11 +17,13 @@ for i, metric in enumerate(metrics):
df = pd.read_csv(f'scores/{specie}_scores{"_minusvocs" if drop_noisy_vocs else ""}{"_minusbins" if drop_noisy_bins else ""}.csv', index_col=0)
df['False alarm'] = 1 - df['False alarm']
ok.loc[specie, df.index] = df[metric]
ok = ok.loc[:,algos]
ok = ok[algos]
# bar plot
ok.plot.bar(rot=22, ax=ax[i])
ax[i].legend(bbox_to_anchor=(1,1))
ax[i].grid()
ax[i].set_title(metric)
m_ax = ax[int(i//2), i%2]
ok.plot.barh(ax=m_ax, legend=None)
m_ax.grid()
m_ax.set_title(metric)
if i%2==1:
m_ax.legend(bbox_to_anchor=(1,1))
plt.tight_layout()
plt.savefig(f'scores{"_minusvocs" if drop_noisy_vocs else ""}{"_minusbins" if drop_noisy_bins else ""}.pdf')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment