Commit b3e41ca3 authored by Marcel Henrik Schubert's avatar Marcel Henrik Schubert
Browse files

seaborn fix

parent e1faeea3
This diff is collapsed.
......@@ -746,7 +746,7 @@ def plotter(subsets, subana, phases, labels):
f = plt.figure()
ax = f.subplots()
cm = cnf_matrix.astype('float') / cnf_matrix.sum(axis=1)[:, np.newaxis]
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = cnf_matrix, fmt = 'd', cbar = True,
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = True, fmt = '.2f', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = phases, yticklabels= phases, ax=ax)
f.savefig(savedir+ 'heatmaps/cm_{st}_{an}_{label}_{group}_seaborn.pdf'.format(st = st,
an=an,
......@@ -819,12 +819,12 @@ def plotter(subsets, subana, phases, labels):
f = plt.figure()
ax = f.subplots()
cm = cnf_matrix.astype('float') / cnf_matrix.sum(axis=1)[:, np.newaxis]
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = cnf_matrix, fmt = 'd', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = phases, yticklabels= phases, ax=ax)
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = True, fmt = '.2f', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = ['female', 'male'], yticklabels= ['female', 'male'], ax=ax)
f.savefig(savedir+ 'heatmaps/cm_{st}_{an}_{label}_{group}_seaborn.pdf'.format(st = st,
an=an,
label=label,
group='life_phase'))
group='gender'))
###make author cmap showing whether the author missclassified
##were confused with authors of similar gender or life_phase
cnf_matrix = confusion_matrix(sub_wrong[an+'_'+str(st)+'_life_phase'],
......@@ -844,7 +844,7 @@ def plotter(subsets, subana, phases, labels):
f = plt.figure()
ax = f.subplots()
cm = cnf_matrix.astype('float') / cnf_matrix.sum(axis=1)[:, np.newaxis]
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = cnf_matrix, fmt = 'd', cbar = True,
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = True, fmt = '.2f', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = phases, yticklabels= phases, ax=ax)
f.savefig(savedir+ 'heatmaps/cm_{st}_{an}_{label}_{group}_seaborn.pdf'.format(st = st,
an=an,
......@@ -868,12 +868,12 @@ def plotter(subsets, subana, phases, labels):
f = plt.figure()
ax = f.subplots()
cm = cnf_matrix.astype('float') / cnf_matrix.sum(axis=1)[:, np.newaxis]
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = cnf_matrix, fmt = 'd', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = phases, yticklabels= phases, ax=ax)
sns.heatmap(cm, vmin=0, vmax=1, cmap= plt.cm.Blues, center = 0.0, annot = True, fmt = '.2f', cbar = True,
cbar_kws= {'label': "Heat per Row (Normalized)"}, square = True, xticklabels = ['female', 'male'], yticklabels= ['female', 'male'], ax=ax)
f.savefig(savedir+ 'heatmaps/cm_{st}_{an}_{label}_{group}_seaborn.pdf'.format(st = st,
an=an,
label=label,
group='life_phase'))
group='gender'))
......
File added
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment