In [1]:
import numpy as np
from scipy.special import expit as sigmoid
r = 90
Phi_val = sigmoid(np.load('results/svm_distance/kern_Phi_val.{}.npy'.format(r))[0])
Phi_val.shape


Out[1]:
(1684, 27)

In [2]:
import pickle
with open('cache/hex.pickle', mode='rb') as h:
    hex_data = pickle.load(h)
id_fh = map(lambda x: max(x, key=len), hex_data['id_hierarchical_labels'])
with open('cache/df_val_test.pickle', mode='rb') as h:
    df_val, _ = pickle.load(h)
Y_val = [id_fh[x] for x in df_val['label']]

In [3]:
for i in range(0, 27):
    mask = [i in y for y in Y_val]
    Phi_val_select = Phi_val[np.nonzero(mask)[0], :]
    print np.mean(Phi_val_select[:, i]), np.std(Phi_val_select[:, i])


0.24099950132 0.0641991066737
0.222776869627 0.0789105281703
0.233721101278 0.0793435686622
0.279729879429 0.113656558199
0.258239158518 0.0950103381947
0.230474704862 0.0936633428171
0.253871642962 0.0853557264687
0.256009719796 0.0800372984785
0.246990667573 0.0846687103144
0.234930445916 0.0751019132628
0.217155678107 0.101009075802
0.236277190553 0.103665990881
0.264677087946 0.0903642572114
0.222748762123 0.0634059146211
0.222021793794 0.0736053065139
0.23328731635 0.0900360861971
0.256815900837 0.107203346884
0.270725076882 0.104158057215
0.270356704624 0.117923326501
0.246589581054 0.107790669085
0.659853447572 0.228020662541
0.570786511199 0.249202374082
0.805292252893 0.194959811146
0.769178400877 0.226786357389
0.781600191813 0.216739860851
0.609829644318 0.238907300959
0.73943730303 0.21514719958

In [ ]: