Results 1 to 3 of 3

Math Help - Algorithm for most viewed records

  1. #1
    Newbie
    Joined
    Jul 2012
    From
    Seattle
    Posts
    18
    Thanks
    2

    Algorithm for most viewed records

    I want to show the top 10 most viewed records on a per user basis. It also needs to be time biased where records viewed long ago carry little weight. The application consists of a user logging onto a private site and viewing real estate opportunities, and having their individual "popular" records displayed when they initially log on.

    One thought was to associate a "rank" for each user/record pair. Every time the record is viewed, the current rank value is decreased based on the age of the rank value, but then increased because it was just viewed.

    Any advise would be much appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,109
    Thanks
    325

    Re: Algorithm for most viewed records

    Personally I think the easiest and most intuitive for the user is to simply rank in order by when the most recent viewing was, and not worry about how many times the listing has been previously seen. Perhaps let the user flag particular listings as being of interest, so that they come to the top regardlesss of when it was last viewed. However, you asked for an algoithm that weighs the time since the most recent viewing together with the number of viewings to produce a score, then rank the listings by score. It all depends how you feel the relative weight of time versus frequency should be handled. For example - if I viewed one listing 4 times last week and not since, and I viewed a second listing just once yesterday, which should score higher? if I viewed a third listing 100 timnes last year but not since how should that be ranked?

    Here's one approach - don't know if it matches what you're expecting, but if you keep track of all viewings by date for each user then you could produce a score for each listing that would be calculated as follows. Let  N = number of viewing of a particular site, T_i = time (in days) elapsed since the i^{th} viewing (i= 1 for today, i=2 for yesterday, etc), then the score  P for that listing would be:

     P = \sum _{i=1} ^{N} \frac 1 {T_i}

    In this systen one viewing today scores 1 point, which equals 2 viewings yesterday but is less than one viewing yesterday plus 2 viewing 2 days ago.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jul 2012
    From
    Seattle
    Posts
    18
    Thanks
    2

    Re: Algorithm for most viewed records

    Thank you ebaines,

    let the user flag particular listings as being of interest
    Nothing to do with math, but with humans! Would rather not add the complexity.

    It all depends how you feel the relative weight of time versus frequency should be handled
    Yea, I know and didn't know how to deal with it.

    Here's one approach
    Doesn't account for how many times viewed per day, but that can easily be added. I would also want to limit N to something reasonable so not to waste computer time on insignificant results. The big question is what are the constants that you eluded on your earlier point about how I/we/you feel the relative weight of time versus frequency should be handled. Don't know. Hoping someone has done research on this.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: January 10th 2012, 12:56 AM
  2. Any metric spaces can be viewed as a subset of normed spaces
    Posted in the Differential Geometry Forum
    Replies: 5
    Last Post: December 15th 2011, 03:00 PM
  3. Number of records (expected value, variance)
    Posted in the Advanced Statistics Forum
    Replies: 2
    Last Post: November 27th 2011, 09:19 AM
  4. NFL Win loss records question
    Posted in the Math Puzzles Forum
    Replies: 0
    Last Post: October 8th 2010, 08:18 PM
  5. World Records
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: November 17th 2009, 05:14 AM

Search Tags


/mathhelpforum @mathhelpforum