efficient library to recommend product based on user history [closed]
-
22-09-2019 - |
Question
I have a database of which products every user has viewed and I want to recommend a product based on what similar users have viewed. Is there a Python library that can achieve this? I don't need Netflix quality results, just products that are more likely than not of interest. Any ideas?
Solution
You can check out pysuggest.
From the site:
SUGGEST is a Top-N recommendation engine that implements a variety of recommendation algorithms. Top-N recommender systems, a personalized information filtering technology, are used to identify a set of N items that will be of interest to a certain user. In recent years, top-N recommender systems have been used in a number of different applications such to recommend products a customer will most likely buy; recommend movies, TV programs, or music a user will find enjoyable; identify web-pages that will be of interest; or even suggest alternate ways of searching for information.
OTHER TIPS
k-Nearest Neighbor is probably the most commonly implemented algorithm for real-time web-based recommender systems.
In NumPy/SciPy you have several choices [note: answer updated in dec 12 to reflect updates in sklearn library]:
nearest neighbors module in scikit-learn (aka sklearn); this is a sophisticated kNN implementation that includes neighbor weighting and voting as well as a very efficient storage/retrieval component (ball tree);
scipy.spatial. I have used this for several projects, though it's unlikely i would use it for my next one given sklearn is now available, which is a more up-to-date implementation of kNN. Still, the spatial module has a kd-tree class (kd-tree rather than standard numpy array is used by this module to store the data, which along w/ Voronoi tesselation, is the most common specialized data structure to store very large data sets for kNN); in addition, it has methods for several distance metrics (aside from Euclidean distance).
Here's another python library to implement a recommender system:
It's very simple to use it! See some examples here:
Quick start¶