Skip to content
Snippets Groups Projects
Commit 9f44976b authored by Noordijk, Ben's avatar Noordijk, Ben
Browse files

Hots hots, better plots

parent 9cbec9d2
No related branches found
No related tags found
1 merge request!3Added data preparation, hyperparameter optimisation, benchmarking code and k-mer library visualisation
import pandas as pd
import argparse
from pathlib import Path
from itertools import chain
from multiprocessing import Pool
import pandas as pd
from sklearn.metrics import ConfusionMatrixDisplay, f1_score, accuracy_score
import matplotlib.pyplot as plt
import seaborn as sns
......@@ -121,21 +123,27 @@ def main():
df = pd.DataFrame.from_records(all_records,
columns=['tool', 'species',
'fold', 'accuracy', 'f1'])
# Set species in alphabetical order
all_species = df.species.unique()
all_species.sort()
# Do basic plotting
df.groupby(['species', 'tool']).mean().plot.bar()
plt.tight_layout()
plt.show()
sns.catplot(x='species', y='accuracy', ci='sd', data=df, hue='tool', kind='bar', legend_out=True)
sns.catplot(x='species', y='accuracy', ci='sd', data=df, hue='tool',
kind='bar', order=all_species, legend_out=False, aspect=2, palette='pastel')
plt.xticks(rotation=90)
plt.tight_layout()
plt.show()
sns.catplot(x='species', y='f1', data=df, hue='tool', kind='bar')
sns.catplot(x='species', y='f1', ci='sd', data=df, hue='tool',
kind='bar', order=all_species, legend_out=False, aspect=2)
plt.xticks(rotation=90)
plt.tight_layout()
plt.show()
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment