Rails 布尔数据的逐项推荐引擎数据库设计?
我一直在研究集体智能编程,到目前为止,进行逐项推荐的算法对我来说足够有意义,但我现在陷入了如何根据作者描述的内容制作一个实际的数据库支持系统的问题。我发现acts_as_recommendable,但据我所知,它看起来已被遗弃。
我想知道的是,假设我有一个如下所示的数据库:
Users:
id
username
Bookmarks:
id
url
UserBookmarks:
user_id
bookmark_id
(简单,用户可以有很多书签,书签可以有很多用户)
现在看看书中的 Delicious 示例中的算法,看起来他们有为 url 添加书签的用户的记录,并且还没有的用户。这显然根本不适合数据库,因为一个具有 1000 个用户系统的新书签将需要 1000 个新数据库记录。或者我只是在这里根本没有得到什么?
您将如何添加到上述数据库架构中,以允许您根据编程集体智能中的美味链接推荐算法来计算书签推荐?
理想情况下,我希望每小时计算一次允许书签相似度,然后在页面加载时简单地查询数据库以获取推荐的网址。这对于 Rails 中标准 mysql 支持的系统来说可能吗?
提前致谢。
I've been studying Programming Collective Intelligence and the algorithms for doing item to item recommendations make enough sense to me so far, but I'm stuck now with how to make an actual database backed system out of what the author describes. I've found acts_as_recommendable, but it looks abandoned from what I can tell.
What I'm wondering, is let's say I have a database laid out like so:
Users:
id
username
Bookmarks:
id
url
UserBookmarks:
user_id
bookmark_id
(simple, users can have many bookmarks, bookmarks can have many users)
Now looking at the algorithms in their Delicious example in the book, it appears they have records for both users who have bookmarked a url, and users who have not. That obviously doesn't lend well to a database at all because one new bookmark with a 1000 user system would require 1000 new database records. Or am I just not getting something at all here?
How would you add to the above database schema to allow you to calculate bookmark recommendations per the delicious link recommendation algorithms in Programming Collective Intelligence?
I would ideally like to calculate allow bookmark similarities maybe hourly and then simply query the database for recommended urls on page load. Is this possible with standard mysql backed system in Rails?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我不是这个领域的专家,但你可能想看看 Neo4J http://neo4j.org/,这是一个具有强大 Rails 支持的图形数据库。我摆弄了一下,看起来非常棒。
i'm unfortunately no expert in this field, but you may wanna take a look at Neo4J http://neo4j.org/, that's a graph database with great Rails support. i've fiddled around with it a bit, and it seems pretty awesome.