views:

215

answers:

2

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 probably of interest. Any ideas?

+5  A: 

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.

danben
+1  A: 

k-Nearest Neighbor is often the algorithmic backbone for recommendation systems. In NumPy/SciPy you have several choices. One is the ANN ('approximate nearest neighbors') library in 'SciKits', a SciPy add-on, which you can download here.

In addition, the SciPy Spatial module (scipy.spatial) is a good choice. I used this for several projects and i can recommend it. What i liked particularly: (i) the built-in 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); (ii) it's very fast; (iii) the documentation is pretty good (what you might not find, you should be able to find in the source); and (iv) it has several built-in methods for distance computation (aside from Euclidean).

doug