Commit 414e2f9d authored by Marcel Henrik Schubert's avatar Marcel Henrik Schubert
Browse files

fixed key error for feature plots

parent 7363d2be
...@@ -900,8 +900,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -900,8 +900,8 @@ def plotter(subsets, subana, phases, labels):
maxi = most_pred[st][an][label][ph]['max_array'] maxi = most_pred[st][an][label][ph]['max_array']
mini = most_pred[st][an][label][ph]['min_array'] mini = most_pred[st][an][label][ph]['min_array']
##make it so that the values of heat are relatively to the min and max values of the feature ##make it so that the values of heat are relatively to the min and max values of the feature
dic[ph+'\n({})'.format(leng)] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= .95} dic[ph] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph]['count_tot_pos'] 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}) dic[ph].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))
...@@ -965,11 +965,11 @@ def plotter(subsets, subana, phases, labels): ...@@ -965,11 +965,11 @@ def plotter(subsets, subana, phases, labels):
maxi = most_pred[st][an][label][sex]['max_array'] maxi = most_pred[st][an][label][sex]['max_array']
mini = most_pred[st][an][label][sex]['min_array'] mini = most_pred[st][an][label][sex]['min_array']
##make it so that the values of heat are relatively to the min and max values of the feature ##make it so that the values of heat are relatively to the min and max values of the feature
dic[sex+'\n({})'.format(leng)] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][sex]['count_tot_pos'] if (el[1]/leng) >= .95} dic[sex] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][sex]['count_tot_pos'] if (el[1]/leng) >= .95}
dic[sex+'\n({})'.format(leng)].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][sex]['count_tot_neg'] if (el[1]/leng) >= .95}) dic[sex].update({el[0]:-(abs(arr[el[0]])/abs(mini[el[0]])).round(3) for el in most_pred[st][an][label][sex]['count_tot_neg'] if (el[1]/leng) >= .95})
ind_pos.extend([el[0] for el in most_pred[st][an][label][sex]['count_tot_pos'] if (el[1]/leng) >= .95]) ind_pos.extend([el[0] for el in most_pred[st][an][label][sex]['count_tot_pos'] if (el[1]/leng) >= .95])
ind_neg.extend([el[0] for el in most_pred[st][an][label][sex]['count_tot_neg'] if (el[1]/leng) >= .95]) ind_neg.extend([el[0] for el in most_pred[st][an][label][sex]['count_tot_neg'] if (el[1]/leng) >= .95])
sex_key.append(sex+'\n({})'.format(leng)) sex_key.append(sex)
for ph in phases: for ph in phases:
leng = most_pred[st][an][label][ph]['number'] leng = most_pred[st][an][label][ph]['number']
...@@ -977,8 +977,8 @@ def plotter(subsets, subana, phases, labels): ...@@ -977,8 +977,8 @@ def plotter(subsets, subana, phases, labels):
maxi = most_pred[st][an][label][ph]['max_array'] maxi = most_pred[st][an][label][ph]['max_array']
mini = most_pred[st][an][label][ph]['min_array'] mini = most_pred[st][an][label][ph]['min_array']
##make it so that the values of heat are relatively to the min and max values of the feature ##make it so that the values of heat are relatively to the min and max values of the feature
dic[ph+'\n({})'.format(leng)] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= 0.95} dic[ph] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph]['count_tot_pos'] if (el[1]/leng) >= 0.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}) dic[ph].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))
...@@ -1036,12 +1036,12 @@ def plotter(subsets, subana, phases, labels): ...@@ -1036,12 +1036,12 @@ def plotter(subsets, subana, phases, labels):
maxi = most_pred[st][an][label][ph][sex]['max_array'] maxi = most_pred[st][an][label][ph][sex]['max_array']
mini = most_pred[st][an][label][ph][sex]['min_array'] mini = most_pred[st][an][label][ph][sex]['min_array']
##make it so that the values of heat are relatively to the min and max values of the feature ##make it so that the values of heat are relatively to the min and max values of the feature
dic[sex+'_'+ph+'\n({})'.format(leng)] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph][sex]['count_tot_pos'] if (el[1]/leng) >= 0.95} dic[sex+'\n'+ph] = {el[0]:(arr[el[0]]/maxi[el[0]]).round(3) for el in most_pred[st][an][label][ph][sex]['count_tot_pos'] if (el[1]/leng) >= 0.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}) dic[sex+'\n'+ph].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)) phase_key.append(sex+'\n'+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