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

analysis split age feature plot into 2

parent 595c6956
......@@ -21,6 +21,7 @@ import math
import statistics
import itertools
import multiprocessing as mp
import math
from sklearn.preprocessing import LabelEncoder
from sklearn.linear_model import PassiveAggressiveClassifier, SGDClassifier
......@@ -851,7 +852,7 @@ def plotter(subsets, subana, phases, labels):
ax = plt.gca()
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.grid(True, axis ='y')
plt.ylim((0,0.7))
plt.ylim((0,.7))
plt.tight_layout()
plt.savefig(savedir+'barplots/overall_scores_{}_{}.pdf'.format(st, an))
plt.savefig(savedir+'barplots/overall_scores_{}_{}.png'.format(st, an))
......@@ -862,10 +863,10 @@ def plotter(subsets, subana, phases, labels):
tmp_df.plot(kind='barh', colormap = cmap, ax=f.gca())
plt.legend(loc='center left', bbox_to_anchor=(1.0, 0.5))
plt.xlabel(xlabel='Evaluation Measures for Author Scores by Gender',fontsize ='large', fontweight='roman')
ax = plt.gca()
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
#ax = plt.gca()
#plt.setp(ax.get_xticklabels(), rotation=45, ha="right",rotation_mode="anchor")
plt.grid(True, axis ='y')
plt.ylim((0,0.7))
plt.ylim((0,.7))
plt.tight_layout()
plt.savefig(savedir+'barplots/author_gender_scores_{}_{}.pdf'.format(st, an))
plt.savefig(savedir+'barplots/author_gender_scores_{}_{}.png'.format(st, an))
......@@ -938,10 +939,20 @@ def plotter(subsets, subana, phases, labels):
if collections.Counter(mask[col])[True] < 1:
ls.append(col)
df.drop(ls, inplace = True)
f,ax = plt.subplots(figsize=(18, len(ind)/6))
sns.heatmap(df, fmt= '.1f',ax=ax, center = 0, yticklabels = True)
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases.pdf'.format(st, an, label))
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases.png'.format(st, an, label))
####plot is too long - half it
half = math.floor(len(df.index))
sub = df[0:half]
f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/5))
sns.heatmap(sub, fmt= '.1f',ax=ax, center = 0, yticklabels = True)
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases_1.pdf'.format(st, an, label))
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases_1.png'.format(st, an, label))
sub = df[half:]
f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/5))
sns.heatmap(sub, fmt= '.1f',ax=ax, center = 0, yticklabels = True)
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases_2.pdf'.format(st, an, label))
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases_2.png'.format(st, an, label))
elif label == 'author':
sex_key = []
......@@ -1006,7 +1017,7 @@ def plotter(subsets, subana, phases, labels):
df.drop(ls, inplace = True)
f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/6))
f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/5))
sns.heatmap(df, fmt= '.1f',ax=ax, center = 0, yticklabels = True)
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases.pdf'.format(st, an, label))
f.savefig(savedir+'featureplots/features_heat_{}_{}_{}_phases.png'.format(st, an, label))
......
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