I’ve got a list of items. Users can occasionally select them. Now I want to order the items by their popularity. What’s a good weighting function for that?
Constraints:
- The weight should be in [0,1)
- Recursive calculation is prefered (not required)
- Newer events must have more influence than old ones.
- I’d favor approved functions. As I’ve developped something like this once and it worked not as expected.
If you have a counter of votes per item, you can use a ‘fading constant’ in order to make older votes “fade away” with time. Something like:
Nvotes(i) = IsClicked(i) + Nvotes(i) * Kfadewhere:
0 < Kfade < 1Thus, whenever a new click is intercepted, all counters are advanced where only the selected item is incremented by 1.
EDIT: Since the total is less than 1, you may want to normalize Nvotes by the total number of clicks so far.