A better default scoring script for Amarok 2
Karthik Periagaram
karthikp at gatech.edu
Mon Dec 15 01:23:46 CET 2008
Thanks to Andreas for raising concerns about the score approaching 100 - in
making the plot I've attached, I found that I left out a damping 0.01 factor
that tempers the effect of the 1/playCount function. The newScore line should
read as follows:
newScore = ( ( 5 * rating + 0.5 * oldScore ) + ( 100 - ( 5 * rating + 0.5 *
oldScore ) ) * ( 0.01 * playCount / ( 0.01 * playCount + 1 ) ) ) * ( 0.9 + 0.1
* playedFraction );
So, I've plotted the effect of my algorithm for three cases. In all the
following cases, the song is assumed to have been played through fully, so
there is no effect of the playedFraction variable.
Case 1 is an unrated song. This is the case that I built the script around.
The user has not bothered to rate the song and the player has to guess how
much s/he likes the song. It's identical to the case where the song is rated
2.5 stars. The score increases sluggishly and reaches about 85 after 100
complete playthroughs. (BLUE)
Case 2 is a song rated 5 stars. It converges to the rating (10) very fast. By
about ten plays, the score is pretty close to 100. (RED)
Case 3 is the contentious one. This is a song the user dislikes and has rated
it 0.5 stars. From Amarok's point of view, if the user has played the song 100
times (and not gotten rid of it by now), the score will increase. After about
a hundred plays, it manages to reach a little less than 70. (GREEN)
So there were three points I wanted to make.
1) The increase is very sluggish. The changes will happen over *hundreds* of
playthroughs. And if skipped, up to 10% of the score is chopped off. So, a
hated song will decidedly have a low score. It is after all, Amarok's best
guess of how much the user likes to have the song around.
2) Scores are useful because they are like automated ratings. It comes in
handy when making smart playlists. I see it as one of Amarok's unique selling
points.
3) It was really easy to change the code even for me, though I just know basic
C++. Kudos to the team for writing such clean, easy-to-play-with code!
As for a skipped song finding its way into the biased playlists, an additional
condition to keep low scored songs out should come in handy...If you want the
effect to be weaker, change the 0.01 factor in to above formula to an even
lower value - say, 0.002 or something. (0 = no effect of playCount; 0.01 =
recommended).
Karthik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 11889 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20081214/c716ed93/attachment-0001.png
More information about the Amarok-devel
mailing list