19

I am looking for a simple suggestion algorithm to implement in to my Web App. Much like Netflix, Amazon, etc... But simpler. I don't need teams of Phd's working to get a better suggestion metric.

So say I have:

  • User1 likes Object1.
  • User2 likes Object1 and Object2.

I want to suggest to User1 they might also like Object2.

I can obviously come up with something naive. I'm looking for something vetted and easily implemented.

4

6 回答 6

11

There are many simple and not so simple examples of suggestion algorithms in the excellent Programming Collective Intelligence

The Pearson correlation coefficient (a little dry Wikipedia article) can give pretty good results. Here's an implementation in Python and another in TSQL along with an interesting explanation of the algorithm.

于 2009-12-04T21:23:40.257 回答
11

尝试使用Slope One算法,它是此类问题最常用的算法之一。

这是t-sql 中的示例实现

于 2009-12-04T21:27:24.383 回答
1

You may wanna look at Association rule learning and Apriori algorithm. The basic idea behind is is that you create rules like "if User like Object1, than User likes Object2" and check how well they describe (your) reality. In your concrete example, this rule would have a Support of 2 (as two Users like Object1) and a confidence of 50% a (as the rule is true in 1 of 2 cases). I've just implemented a basic proofe of concept myself (actually my first steps on Hadoop) and it's not too difficult to do.

Alternatively, you may wanna look at Apache Mahout - Taste. I did't ever use it myself though.

于 2009-12-04T21:25:44.840 回答
1

我会和K个最近的邻居一起去。维基百科条目很好地解释了它,并有参考实现的链接。

于 2009-12-04T21:29:35.343 回答
0

k-最近邻算法

于 2009-12-04T21:39:38.740 回答
0

我创建了一个建议文章算法,该算法使用关键字(而不是“产品购买”)来确定相关性。它需要一个关键字,并遍历所有其他出现该关键字的文章,并根据哪些文章具有最匹配的关键字来产生结果。

除了明显需要缓存这些信息之外,他使用类似的方法有什么问题吗?

于 2010-04-06T19:43:35.263 回答