I have a ranking system where users can upvote/downvote(+1/-1) objects, and each object has a cumulative rating_sum
, which can be negative, zero or positive. I also record total number of times the objects has been rated in rating_count
. I can thus get the number of up votes and down votes with a bit of algebra.
I want to implement a scoring algorithm that takes into account the objects rating, but also means older objects get penalised and have a lower score.
So far I found the following:
score=rating_sum/(age^gravity)
where gravity
is some constant (I've been using gravity=2
).
This works OK, except for ratings with negative values, in which case the older the object, the greater (less negative) its score. This means that given two objects with the same negative rating, say -2, the older one scores above the younger, and floats higher.
Is there a scoring algorithm out there I could use that would work for negative ratings too?
(For technical reasons (I'm trying to optimize by using the django ORM), I would like an algo that is fairly simple and I can put into an SQL query statement, so just POW, LOG preferably)