Item-to-item collaborative filtering, how to manage similarity matrix?

北慕城南 提交于 2019-12-12 02:37:29

问题


I am working on a recommendation engine and one problem I am facing right now is the similarity matrix of items are huge.

I calculated similarity matrix of 20,000 items and stored them a a binary file which tuned out to be nearly 1 GB. I think it is too big.

what is the best way do deal with similarity matrix if you have that many items?

Any advice!


回答1:


In fact similarity matrix is about how object similar to another objects. Each row consist of neighbors of object(row id), but you don't need to store all of neighbors, store for example only 20 neighbors. Use lil_matrix: from scipy.sparse import lil_matrix



来源:https://stackoverflow.com/questions/42545775/item-to-item-collaborative-filtering-how-to-manage-similarity-matrix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!