开发者

Best way to implement a Neighborhood model in Rails?

开发者 https://www.devze.com 2023-01-24 17:23 出处:网络
This concept is widely used and it\'s name varies on every site. In some is \"similar to you\", \"relevant to you\", or just \"neighborhoods\" as last.fm call it.

This concept is widely used and it's name varies on every site. In some is "similar to you", "relevant to you", or just "neighborhoods" as last.fm call it.

The input that i have and may be valuable for this:

  • like/unlike button on each user.post
  • i'm follo开发者_StackOverflowwing certain users (maybe i can look for the ones these are following?).

What is the best approach to accomplish this and how would it be implemented in Ruby on Rails?

Thank you!


I have most commonly seen this implemented with acts-as-taggable. StackExchange supports using tags to organize questions. The tags can be user modifiable or not and let you organize data fairly easily. Then interactions in areas that are tagged as X mean that other areas tagged X are of interest. Like and unlike could be given more weight in tagged areas. Then you could develop relevance scores.

Think simple-
any post in tagged X is +1 relevance to that tag
any like in a tagged area X is +5 relevance to that tag

Think advanced-
if likes posts from user y
find relevance scores for user y.
divide scores by 2 and add to core relevance scores
store this as secondary relevance

one or both can be reasonably implemented and stored separately to determine user preference from a test group.

0

精彩评论

暂无评论...
验证码 换一张
取 消