tags:

views:

25

answers:

1

So I'm sure someone has already done something similar. I've got a custom list of links, and track how many times they were clicked, and when last they were clicked. I want to sort them somehow usefully based upon both factors. Anyone can point me towards an existing solution or better yet discussion thereof? I have a few ideas of how this could be implemented, but expect there is an easier answer. EDITED FOR CLARIFICATION (was using phone to post):

So my current idea is to halve the weight of the clicks, double each period, with a period being a day. That is:

Day ... # Clicks are
<1 ..... Full Value
<2 ..... Halved value
<4 ..... 1/4th value
<8 ..... 1/8th value

The premise being that both recency and frequency of clicks means it would be more useful to have them first in the list.

+2  A: 

One of the simplest way is just a weighted mean of both values, you should first normalize them according to their max value like

  • find max number of clicks between all links
  • calculate a normalized clicks value as clicks / maxClicks, this will span from 0.0 to 1.0
  • choose a max threshold of oldness of your links (for example 4 months)
  • calculate a normalized 'freshness' value as (now - lastVisited) / threshold, discarding all items that had been clicked before your threshold
  • calculate a weighted mean as normalizedClickValue * alpha + normalizedFreshness * (1.0 - alpha)

You can start from something like this and then tweak it according to your needs..

Jack
What is "alpha" here? This is definitely the type of thing suggestion I was looking for!
aslum
It's a factor that you choose in range (0.0, 1.0) to express how much weight you want to do to first of two factors involved in the average
Jack