#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    2
    Rep Power
    0

    Best song algorithm


    Hello to all,

    I need an advise on how to do that :

    I am building a sort of jukebox program, with a songs database, that will play songs requested by users. When there are no requests, the jukebox plays songs randomly. Well not completely randomly, as I wish it could be smart and picks more often the songs users love and less often the songs they dont like.

    My database contains the table T_Songs with these fields :
    [Song_Name]
    [Date_last_played]
    [Date_last_requested]
    [Date_last_skipped]
    [Times_played] //number of times that the song as been played
    [Times_requested] //number of user requests (users like it)
    [Times_skipped] //number of times the song as been skipped (users dont like it)

    Which algorithm should a write to sort this database and find the bests songs to play right now ?

    Thanks in advance for your help
    Bernard Cortesi

    Comments on this post

    • JimmyGosling agrees
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Oxford, UK
    Posts
    28
    Rep Power
    0
    What you want is a Markov model to tell you what song to play next, and some additional weighting which reflects how much each person likes that song.

    Comments on this post

    • JimmyGosling agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    NYC
    Posts
    79
    Rep Power
    13
    I didn't think this through thoroughly, but my first reaction is to say that you have to make some kind of decision about how important the characteristics are that you mentioned - the problem is arbitrary without that.

    My first approach would be: for each song, add one to the number of times it has been played (so each song gets representation). I'll ignore the number of times requested, since presumably songs that have been played a large number of times got that way because they were most often requested. That is to say, the non request contribution, per song, I would expect to be small. Now I would scale this number down by the percent of times the song was skipped. E.g. Played 99 times, skipped 10 times => (1+99)*(99-10)/99 (or something similar).
    So now I would pick one of the songs at random, in relative proportion to this number just computed.

    Csaba Gabor

    Comments on this post

    • JimmyGosling agrees
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Posts
    2
    Rep Power
    0
    Ostrich, I've looked to web for this Markov model, and damn, examples that I've found deal with speech recognition or genetical studies...
    I'm not going to implement such a mamoth algorithm for the simple thing I need.
    But thanks anyway for the idea.

    The post from Csaba Gabor seems very interresting, I've implemented the algorithm you've talked about and finally got something that is close to what i needed. Thanks for the hint.

IMN logo majestic logo threadwatch logo seochat tools logo