Commit 7363d2be authored by Marcel Henrik Schubert's avatar Marcel Henrik Schubert
Browse files

fixed halfing error

parent d94299a1
...@@ -904,7 +904,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -904,7 +904,8 @@ def plotter(subsets, subana, phases, labels):
dic[ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95}) dic[ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95})
ind_pos.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= .95]) ind_pos.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= .95])
ind_neg.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95]) ind_neg.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95])
phase_key.append(ph+'\n({})'.format(leng)) #phase_key.append(ph+'\n({})'.format(leng))
phase_key.append(ph)
ind_pos = list(np.unique(ind_pos)) ind_pos = list(np.unique(ind_pos))
ind_neg = list(np.unique(ind_neg)) ind_neg = list(np.unique(ind_neg))
...@@ -942,7 +943,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -942,7 +943,8 @@ def plotter(subsets, subana, phases, labels):
####plot is too long - half it ####plot is too long - half it
half = math.floor(len(df.index)) half = math.floor(len(df.index)/2)
sub = df[0:half] sub = df[0:half]
f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/5)) f,ax = plt.subplots(figsize=(18, len(ind_pos+ind_neg)/5))
sns.heatmap(sub, fmt= '.1f',ax=ax, center = 0, yticklabels = True) sns.heatmap(sub, fmt= '.1f',ax=ax, center = 0, yticklabels = True)
...@@ -979,7 +981,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -979,7 +981,8 @@ def plotter(subsets, subana, phases, labels):
dic[ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95}) dic[ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95})
ind_pos.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= .95]) ind_pos.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= .95])
ind_neg.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95]) ind_neg.extend([el[0] for el in most_pred[st][an][label][ph]['count_tot_neg'] if (el[1]/leng) >= .95])
phase_key.append(ph+'\n({})'.format(leng)) #phase_key.append(ph+'\n({})'.format(leng))
phase_key.append(ph)
ind_pos = list(np.unique(ind_pos)) ind_pos = list(np.unique(ind_pos))
ind_neg = list(np.unique(ind_neg)) ind_neg = list(np.unique(ind_neg))
...@@ -1037,7 +1040,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -1037,7 +1040,8 @@ def plotter(subsets, subana, phases, labels):
dic[sex+'_'+ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph][sex]['count_tot_neg'] if (el[1]/leng) >= .95}) dic[sex+'_'+ph+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][ph][sex]['count_tot_neg'] if (el[1]/leng) >= .95})
ind_pos.extend([el[0] for el in most_pred[st][an][label][ph][sex]['count_tot_pos'] if (el[1]/leng) >= .95]) ind_pos.extend([el[0] for el in most_pred[st][an][label][ph][sex]['count_tot_pos'] if (el[1]/leng) >= .95])
ind_neg.extend([el[0] for el in most_pred[st][an][label][ph][sex]['count_tot_neg'] if (el[1]/leng) >= .95]) ind_neg.extend([el[0] for el in most_pred[st][an][label][ph][sex]['count_tot_neg'] if (el[1]/leng) >= .95])
phase_key.append(sex+'_'+ph+'\n({})'.format(leng)) #phase_key.append(sex+'_'+ph+'\n({})'.format(leng))
phase_key.append(sex+'\n({})'.format(ph))
ind_pos = list(np.unique(ind_pos)) ind_pos = list(np.unique(ind_pos))
ind_neg = list(np.unique(ind_neg)) ind_neg = list(np.unique(ind_neg))
......
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