In [2]:
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
In [37]:
df = pd.read_csv('./combined_test_results.csv', index_col=0, header=0)
In [43]:
df.columns = ['Group', 'Threshold_Percentage',
'True_Positive', 'False_Positive',
'True_Negative', 'False_Negative',
'True_Positive_Rate', 'True_Negative_Rate',
'Positive_Predictive_Value', 'Negative_Predictive_Value',
'False_Negative_Rate', 'False_Positive_Rate',
'False_Discovery_Rate', 'False_Omission_Rate',
'Accuracy', 'F1',
'Matthews_Correlation_Coefficient', 'AUROC',
'AUPR_0', 'AUPR'
]
df
Out[43]:
In [44]:
labels=df.columns.values[2:]
labels
Out[44]:
In [40]:
# Compare AUROC results for all 18 labels
# based on their groupings
label = 'AUROC'
sns.set_context("paper", font_scale=1.6)
sns.set_palette("Greys_r")
auroc_ax = sns.barplot(x='Group', y=label,
hue='Threshold_Percentage', data=df)
auroc_ax.set(ylabel=label)
auroc_ax.legend(ncol=2, bbox_to_anchor=(1.05, 1),loc=0, frameon=True, title="Threshold Percentage")
plt.xticks(rotation=15)
Out[40]:
In [41]:
# Compare TPR results for all 18 labels
# based on their groupings
label = 'True_Positive_Rate'
sns.set_context("paper", font_scale=2)
sns.set_palette("Greys_r")
plt.figure(figsize=(12,10))
auroc_ax = sns.barplot(x='Group', y=label,
hue='Threshold_Percentage', data=df)
auroc_ax.set(ylabel=label)
auroc_ax.set(xlabel="Classifier Group")
auroc_ax.legend(ncol=2, loc=0, frameon=True, title="Threshold Percentage")
plt.xticks(rotation=15)
Out[41]:
In [46]:
# Compare TPR results for all 18 labels
# based on their groupings
for lbl in labels:
label = lbl
sns.set_context("paper", font_scale=2.5)
sns.set_palette("Greys_r", 6)
plt.figure(figsize=(14,8))
auroc_ax = sns.barplot(x='Group', y=label,
hue='Threshold_Percentage', data=df)
auroc_ax.set(ylabel=label)
auroc_ax.set(xlabel="Classifier Group")
auroc_ax.legend(ncol=2, bbox_to_anchor=(1.05, 1),loc=0, frameon=True, title="Threshold Percentage")
#lgd = auroc_ax.legend(ncol=2, bbox_to_anchor=(1.05, 1),loc=0, frameon=True, title="Threshold Percentage")
lgd = auroc_ax.legend(ncol=2, loc=0,frameon=True, title="Threshold Percentage")
plt.xticks(rotation=15)
plt.tight_layout()
plt.savefig(label + '.png', bbox_extra_artists=(lgd,), bbox_inches='tight')
plt.show()
In [ ]: