1

I'm designing a site and don't know how to rate the system in terms of logic.

Outcome is I want an item with 4 stars with 1000 votes to be ranked higher than an item with 1 vote of 5 stars. However, I don't want an item with 1 star with 1000 votes to be ranked higher than an item with 4 stars and 200 votes.

Anyone have any ideas or advice on what to do?

I found these two questions

Sorting by weighted rating in SQL?

MySQL Rating System - Find Rating

and they have their drawbacks and in the first one I don't understand what the winner means by "You may want to denormalize this rating value into event for performance reasons if you have a lot of ratings coming in." Please share some insight? Thank you!

Community
  • 1
  • 1
Darius
  • 1,613
  • 5
  • 29
  • 58
  • 1
    You should start with defining strict formal rules to what should be ranked higher than what. Without this you can't do anything. – Sergio Tulentsev Apr 14 '12 at 07:52
  • I understand it's quite a broad question, but I was hoping that someone might be able to tell me if there's a generic formula for this, something that youtube or an art site like deviantart is using. I feel like I just lack knowledge and something already exists as a standard. Thanks for the interest and responding! – Darius Apr 14 '12 at 07:56
  • Then you should have formulated question like that. There's no such formula. Every big site defines its own criteria for sorting. – Sergio Tulentsev Apr 14 '12 at 07:58

2 Answers2

1

Here's a quick sketch-up of such a system which works by defining a bonus factor xₙ for each flag number. According to your question you want:

x₄*4*1000 > x₅*1*5

and

x₁*1*1000 < x₄*4*200

Setting the factors to for example x₁=1, x₄=2 and x₅=2 will satisfy this, but you will of course want to adjust it and add the missing factors.

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
1

He means, you should put rating-data into the event-table (and thus have redundant data) to optimize it for performance.

See the wiki for Denormalization: http://en.wikipedia.org/wiki/Denormalization

The data you have to determine the rank of items is:

  • average rating
  • number of ratings

The hard part is probably to make rules for the ranking. Like: If the average rating for an item > 4 and the number of ratings < 4 treat it like rated 3.9

For convenience, I would put this value (how to treat the items for ranking) in the item-table.

The_Fritz
  • 452
  • 3
  • 17