I have a certain amount of tuples, which contain a signed integer (between -1 and 1) and a five-star rating (where the higher the signed integer is, the more important the rating is).
I want to get an "average" rating, and beforehand I would just compute this, however it seems that it would be better if I weigh the rating using the accompanying integer. I tried min-max normalization and subsequently dividing by the sum, however the rating with smallest integer would get a weight of 0 (thus not count towards the final rating) and that is not what I want.
I am looking to use all ratings for the computation, but a rating in a tuple with a positive integer should be more important than a rating in a tuple with a negative integer, or a rating with a smaller integer. I can imagine there would probably be a lot of different ways to tackle this, but I'm just not sure what a nice systematic way is.
Thanks a lot, if there is anything unclear please let me know (:
I suggest a simple $$\dfrac{\sum_{(s,r)} (s+2)r}{\sum_{(s,r)}(s + 2)}$$ where the sum is over all pairs with $s$ being the signed integer, and $r$ being the rating. The reason for adding $2$ to the signs is that it insures the denominator is never $0$. We have that ratings with $-1$ signs count for less than ratings with $0$ signs, which count for less than ratings with $1$ signs.
A more general method is for you to decide on positive values $w_{-1}, w_0, w_1$ representing how much weight a $-1$ rating, $0$ rating, or $1$ rating should be given. Then the average rating is $$\dfrac{\sum_{(s,r)} w_sr}{\sum_{(s,r)}w_s}$$
For example, if you decide that a $0$ rating should be worth half as much as a $1$ rating, but a $-1$ rating should only be worth one tenth as much as a $1$ rating, you could pick $$\begin{align}w_{-1} = 1\\w_0 = 5\\w_1 = 10\end{align}$$
Again, the reason you want all three $w_s$ to be positive is to avoid $0$ denominators. If you were to pick $w_{-1} = 0$ and all your ratings for something happened to have a sign of $-1$, the calculation would involve a division by $0$.
This gives you the freedom to pick just how much worth should be applied to each sign.