Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Burkhardt committed Aug 19, 2021
1 parent c6b775e commit 45f8a43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ def continuous_to_categorical(self):
self.truths = np.digitize(self.truths, bins)-1
self.preds = np.digitize(self.preds, bins)-1

def plot_confmatrix_mew(self, plot_name):
def plot_confmatrix(self, plot_name):
fig_dir = self.util.get_path('fig_dir')
labels = ast.literal_eval(glob_conf.config['DATA']['labels'])
plt.figure() # figsize=[5, 5]
cm = confusion_matrix(self.truths, self.preds, normalize = 'true')
cm = confusion_matrix(self.truths, self.preds, normalize = None) #normalize must be one of {'true', 'pred', 'all', None}
disp = ConfusionMatrixDisplay(confusion_matrix=cm, display_labels=labels).plot(cmap='Blues')
print(f'plotting conf matrix to {fig_dir+plot_name}')
plt.title('Confusion Matrix')
plt.savefig(fig_dir+plot_name)
plt.close()


def plot_confmatrix(self, plot_name):
def plot_confmatrix_old(self, plot_name):
fig_dir = self.util.get_path('fig_dir')
sns.set() # get prettier plots
labels = ast.literal_eval(glob_conf.config['DATA']['labels'])
Expand Down

0 comments on commit 45f8a43

Please sign in to comment.