views:

87

answers:

2

Guys,

Based on this url i found Bayesian Rating, which explains the rating model very well, i wanted to summarize the formula to make it much easier for anyone implementing an SQL statement. Would this be correct if i summarized the formula like this?

avg_num_votes  = Sum(votes)/Count(votes) * Count(votes)

avg_rating     = sum(votes)/count(votes)

this_num_votes = count(votes)

this_rating    = Positive_votes - Negative_votes

Gath

A: 
avg_num_votes  = Sum(votes for all items)/Count(votes for all items) 

avg_rating     = Sum(Ratings for all items) / Count(items)

this_num_votes = Count(votes for THIS item)

this_rating    = Positive_votes - Negative_votes --- For this item
belisarius
+1  A: 

It would look more like this:

avg_num_votes  = Count(votes)/Count(items with at least 1 vote)
avg_rating     = Sum(votes)/Count(items with at least 1 vote)

this_num_votes = Count(votes for this item)
this_rating    = Sum(votes for this item)/Count(votes for this item)

If you are using a simple +/- system, Sum(votes) = Count(positive votes) (ie. treat + as 1, - as 0)

See also: Bayesian average.

BlueRaja - Danny Pflughoeft