Closed SeekPoint closed 6 years ago
@loveJasmine Hi, this is caused by the update of bottleneck module used in this code. I recommend you install the bottleneck version (1.1.0).
Besides, I checked the update log of bottleneck in the 1.2.0 version: https://kwgoodman.github.io/bottleneck-doc/release.html?highlight=argpartsort
Functions partsort and argpartsort have been renamed to partition and argpartition to match NumPy. Additionally the meaning of the input arguments have changed: bn.partsort(a, n) is now equivalent to bn.partition(a, kth=n-1). Similarly for bn.argpartition.
Thus as an alternative, you can change the code accordingly.
it works!thanks
get 39244 review from data/yelp-50k/exp_split/1/rids.txt get 10 aspect from data/yelp-50k/exp_split/1/aids.txt UBU((13664, 13664)), density=0.95760 cost 6.83 seconds UBUB((13664, 8165)), density=0.81269 cost 11.37 seconds get top 500 items, total 6832000 entries, cost 16.31 seconds save 6832000 triplets in data/yelp-50k/exp_split/1/sim_res/path_count/URPARUB_top500.res finish saving 6832000 URPARUB entries in data/yelp-50k/exp_split/1/sim_res/path_count/URPARUB_top500.res, cost 27.77 seconds cal commut mat for URNARUB, filenames: data/yelp-50k/exp_split/1/uids.txt, data/yelp-50k/exp_split/1/bids.txt, data/yelp-50k/exp_split/1/uid_pos_bid.txt get 13664 user from data/yelp-50k/exp_split/1/uids.txt get 8165 biz from data/yelp-50k/exp_split/1/bids.txt get 39244 review from data/yelp-50k/exp_split/1/rids.txt get 10 aspect from data/yelp-50k/exp_split/1/aids.txt UBU((13664, 13664)), density=0.18198 cost 1.43 seconds UBUB((13664, 8165)), density=0.27085 cost 3.08 seconds get top 500 items, total 2960500 entries, cost 12.40 seconds save 2960500 triplets in data/yelp-50k/exp_split/1/sim_res/path_count/URNARUB_top500.res finish saving 2960500 URNARUB entries in data/yelp-50k/exp_split/1/sim_res/path_count/URNARUB_top500.res, cost 16.72 seconds cal commut mat for UUB, filenames: data/yelp-50k/exp_split/1/uids.txt, data/yelp-50k/exp_split/1/bids.txt, data/yelp-50k/exp_split/1/uid_pos_bid.txt get 13664 user from data/yelp-50k/exp_split/1/uids.txt get 8165 biz from data/yelp-50k/exp_split/1/bids.txt get 39244 review from data/yelp-50k/exp_split/1/rids.txt get 10 aspect from data/yelp-50k/exp_split/1/aids.txt UBU((13664, 13664)), density=0.00014 cost 0.00 seconds UBUB((13664, 8165)), density=0.00118 cost 0.00 seconds get top 500 items, total 129658 entries, cost 8.13 seconds save 129658 triplets in data/yelp-50k/exp_split/1/sim_res/path_count/UUB_top500.res finish saving 129658 UUB entries in data/yelp-50k/exp_split/1/sim_res/path_count/UUB_top500.res, cost 8.34 seconds to dense RA(39244, 10) cost 0.00 seconds Traceback (most recent call last): File "200k_commu_mat_computation.py", line 476, in
cal_yelp_all(split_num, dt)
File "200k_commu_mat_computation.py", line 459, in cal_yelp_all
cal_rar(path_str)
File "200k_commu_mat_computation.py", line 338, in cal_rar
RAR_csr = cal_rar_block(RA, len(rid2ind), ind2rid, step=20000)
File "200k_commu_mat_computation.py", line 387, in cal_rar_block
top100_inds = bn.argpartsort(-dot_res, tmp_topK, axis=1)[:,:tmp_topK]#10000 * 100,100 indices of the top K weights, column indices in dot_res
AttributeError: 'module' object has no attribute 'argpartsort'
mldl@ub1604:~/ub16_prj/FMG$
mldl@ub1604:~/ub16_prj/FMG$