"""ev3.py tag cut(23|25|26) seeds(comma) [step]: score variants of gcn3 embeddings; gain over base+G8 (tuned w) and over base.""" import sys,os,numpy as np; sys.dont_write_bytecode=True sys.path.insert(0,'/workspace/huawei/v21graph2') from ana import * # evalg, gfeat, zs, feats O3='/workspace/huawei/v21graph3/out/' KO={23:3,25:5,26:6}; TB={23:'val23',25:'val25',26:'val26'} def scores(tag,c,seed,step=650): e=np.load(O3+f'emb_{tag}_k{KO[c]}_s{seed}.npz'); U,V=e[f'U{step}'],e[f'V{step}'] F=feats(TB[c],U,V); T=load_tab(TB[c]); NU=len(U) u=np.minimum(T['user'],NU-1); it=T['item'] out={k:F[k] for k in ('s_uv','s_h','cos_mean')} out['bi']=e[f'bi{step}'][it]; out['bu']=np.where(T['user']