diff --git a/Scripts/Analysis_final_mult.py b/Scripts/Analysis_final_mult.py index 57589acb9b211ff90ab3ca9747c7bdd42f056d55..db43080a23ef23ea0675964d8aed527c5057a04a 100644 --- a/Scripts/Analysis_final_mult.py +++ b/Scripts/Analysis_final_mult.py @@ -655,10 +655,9 @@ def plotter(subsets, subana, phases, labels): cnf_matrix = confusion_matrix(df_dic[st][an]['df'][an+'_'+str(st)+'_life_phase'], life_ph_pred_auth, labels=phases) - print(cnf_matrix) - print(np.shape(cnf_matrix)) - print(len(phases)) + f = plt.figure() + ax = f.subplots() plot_confusion_matrix(cnf_matrix, classes=phases,title=None, ax=ax) plt.show() plt.tight_layout() @@ -686,7 +685,8 @@ def plotter(subsets, subana, phases, labels): gen_pred_auth, labels=['female', 'male']) f = plt.figure() - plot_confusion_matrix(cnf_matrix, classes=['female', 'male'],title=None) + ax = f.subplots() + plot_confusion_matrix(cnf_matrix, classes=phases,title=None, ax=ax) plt.tight_layout() f.savefig(savedir+'heatmaps/cm_{st}_{an}_{label}_{group}.png'.format(st = st, an=an, label=label, @@ -698,6 +698,7 @@ def plotter(subsets, subana, phases, labels): life_ph_pred_auth_wrong, labels=phases) f = plt.figure() + ax = f.subplots() plot_confusion_matrix(cnf_matrix, classes=phases,title=None, ax=ax) plt.tight_layout() f.savefig(savedir+'heatmaps/cm_{st}_{an}_{label}_{group}_false.png'.format(st = st, an=an, @@ -709,7 +710,8 @@ def plotter(subsets, subana, phases, labels): gen_pred_auth_wrong, labels=['female', 'male']) f = plt.figure() - plot_confusion_matrix(cnf_matrix, classes=['female', 'male'],title=None, ax=ax) + ax = f.subplots() + plot_confusion_matrix(cnf_matrix, classes=phases,title=None, ax=ax) plt.tight_layout() f.savefig(savedir+'heatmaps/cm_{st}_{an}_{label}_{group}_false.png'.format(st = st, an=an, label=label,