Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I am trying to derive a formula for my collaborative algorithm problem to calculate popularity rating of an item.

I am considering three factors to calculate rating for an item based on three different ratings $a$, $b$ and $c$, each with weight $w_1$, $w_2$ and $w_3$. The cumulative rating is:

$$w_1 a + w_2 b + w_3 c$$

In this equation, I want to give $b$ less weight than $a$, i.e. $w_1 > w_2 > w_3$.

But the problem is that how should I decide/calculate the weights such that they maintain this relative ordering when normalized (I am not looking for linear normalization) i.e.

$$w_1 a > w_2 b > w_3 c$$

Is there a way to calculate $w_1$, $w_2$, $w_3$ dynamically and what normalization process I should use or is recommended?

It would be really helpful to get comments on the approach as well.

share|improve this question

migrated from programmers.stackexchange.com Jan 30 '12 at 11:48

1 Answer

up vote 2 down vote accepted

So if I take an example of (5, 7, 4), we must have:

w1 × a > w2 × b > w3 × c
w1 × 5 > w2 × 7 > w3 × 4
▪ w1 > ⁷⁄₅ w2 and
▪ w3 < ⁷∕₄ w2

With more ratings, you will have:

f(m) = (∑ x=1, m (wₓaₓ))

with:

wₓ₋₁aₓ₋₁ > wₓaₓ for each x with 1 < x ≤ m

If you translate this to code, you'll easily find that you can choose each weight from it's neighbor. Since wₓ₋₁aₓ₋₁ > wₓaₓ, given aₓ₋₁ and aₓ, you can loop through a list starting from the first or the last item, and assign the weights accordingly.

Rating previous = this.Ratings.First();
foreach (Rating current in this.Ratings.Skip(1))
{
    current.Weight = (previous.Weight * previous.Rating) / current.Rating - 1;
    previous = current;
}
share|improve this answer
thanks. It has given me the necessary thought process to move ahead. – krammer Jan 30 '12 at 12:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.