Giant Pygmy Audio Recording Logo


DADA Auto-Rating (DAR v.1.6.4) for foobar2000 v.1.1+

Date and duration adjusted auto-rating algorithm

The DADA Auto-Rating algorithm (DAR) automatically rates music according to a variety of statistics collected by foobar2000's official "playback statistics" plugin.

If done well, an auto-rating algorithm will simply tell you what your favourite (and conversely, least favourite) music is, and the rating will be derived from and reflect actual listening behaviour. This is quite different from manual ratings (e.g. 1 - 5 stars set by the user), since there's very often a disparity between what we'd like ourselves to like, and what we actually like. For those interested in uncovering their actual musical tastes, a good auto-rating formula can be quite illuminating.


Getting DAR working in foobar2000 v.1.1+

Firstly, if you don't already have them, you'll need the following:

Follow the instructions in the text file linked to above.

Very simply you paste the code into Yirkha's foo_dynfil component:

[click on the image to enlarge]
foobar2000 foo_dynfil with DAR code

Create a custom column with %_dynamic_rating%, and under Library > (select) "Recalculate dynamic fields".

To create an autoplaylist ranked according to the DAR algorithm:

  • Go to: Library > Search > and paste: " %_dynamic_rating% GREATER 0 " (without the inverted commas) into the search box.
  • Click on the [...] button and select: "Create Autoplaylist"
  • Right click on the New Playlist and select "Autoplaylist properties"
  • Enter " $sub(99999,%_dynamic_rating%) " in the box as per below:
foobar2000 autoplaylist properties setup

Congratulations. Your music is now being rated automatically by DADA Auto-Rating and foobar2000.

For those interested in what the DAR algorithm actually does, read on ...


The auto-rating dilemma

The DAR algorithm solves a number of problems related to auto-rating music:

  • The Plays per Period problem:
    "Total Playcount" / "No. Days in Library" will give an unfair advantage to new tracks.

  • The Total Playcount problem:
    Total playcount will give an unfair advantage to old tracks.

  • The Track Duration & Playcount problem:
    Song A = 30 mins, Song B = 3 mins, the opportunity cost of listening to Song A is listening to Song B 10 times. If playcount is at the root of the rating (and it has to be), somehow duration has to be factored in, because we are physically limited by time (lifetime/listening time). No matter how much one likes Song A you simply cannot fit as many plays of that track into a lifetime as you can with Song B. So all other things being equal, Song B has an advantage (due to its duration) and this has to be adjusted for.
the auto-rating problem

The DAR formula attempts to equalise these issues so that regardless of the above, all tracks are rated on a level playing field. As you can see below, new tracks (e.g. 35 days old, playcount = 13) are competing with old tracks (757 days old, playcount = 43).

DAR top 10
(obviously this data would normally accompany Track Title & Artist etc...)


Duration

As the graph below illustrates, if duration is not taken into account at all, then a track listened to for 2,700 seconds achieves the same rating (9889) as one listened to for 27,000 seconds (10 times as long). However, if one takes absolute account of duration then the playcount of a song becomes almost secondary. DAR strikes an even balance between playcount and total listening time.

[click on the graphs to enlarge]

duration recalibrated

The graph below is a useful way to express the problem. From the "playcount" point of view it seems as though long tracks have a distinct advantage (e.g. to achieve a rating of 10500 after 900 days, a 4 min song has to be played approx 57 times), however, for the same rating, a 20 minute song need only be played about 25 times, so it seems unfair. Yet from the "total listening time" point of view, the 20 min song is playing for more than double the time.


listening time versus play count

Age

The DAR algorithm uses two independent formulas (one for old and one for new tracks) to suppress or boost the effect of time on a tracks rating. Below, the 30 min track shows the effect of boosting or suppressing both simultaneously; the 3 min track shows an example of suppressing one (i.e. old tracks) while boosting the other (i.e. new tracks) and vice versa. Adjusting these variables may be of use for people with very small (1,000 tracks) or very large collections (i.e. 50,000 tracks).

NOTE: The old track suppression variable has changed slightly since version 1.6.4 (see the graph beneath this one).


age advantage suppression variables

Since v1.6.4 the old track suppression multiplier is now a dynamic variable. The effect has been to reduce the "performance burden" of older tracks with each additional year in the collection.


old age advantage suppression variable since DAR 1.6.4

The "play per period problem" especially in the first few days can have a profoundly distorting effect. For example, you may have a track you've played 100 times in 2 years (that's a lot!), which means you play that track approx. 1 day in every 7. However, a new song played twice, straight away (has been played 2 times in 1 day), when extrapolated this suggests it will be played 14 times every 7 days, i.e. it's 14 times more popular (on a "plays per day" measure) than the track you played 100 times. Yet, it's highly unlikely you'll end up listening to that song 1400 or so times over 2 years.

For this reason, the DAR formula suppresses this effect in proportion to the age of the track. You can see this below in the playcount required to achieve a constant rating (for a rating of 10109 a brand new track has to be played almost 6 times, for the same rating after 9 weeks, the same track only has to be played 10 times).


constant rating versus constant play rate

Low Playcounts & Predictability

When tracks have a very low playcount (i.e. < 5) the effects of the low playcount penalty are a dominant factor in the DAR rating scheme. As the playcount increases this effect diminishes quickly (ultimately to zero). It's primary purpose is to spread the rating over a wide range. Furthermore, a track played just once or twice, whether long or short, young or old cannot be said to be a favourite, and with so few plays predicting its popularity is problematic.


low playcount mechanism



Lessons learnt & problems solved

When the first DAR formula was released (then called foo_DAR) on the foobar2000 forum at Hydrogen Audio, a number of issues were raised, these have all been remedied:

  • The Probation Period: SOLVED (no longer required, instead DAR has a mechanism that subdues the distorting "play per period effect" of very new tracks)

  • The %SKIP% Issue: SOLVED (abandoned the use of %skip% as a measure of listening behaviour)

  • The First Played Penalty: SOLVED (this has been greatly reduced and is now part of a general low playcount penalty - see above graph)

Back then DAR (foo_DAR) utilised the infamous cwb_hooks (an unofficial 3rd party component). This supplied foobar2000 with a system date time, and this was critical to all auto-rating algorithms. When this component was deprecated (foobar2000 0.9.5+) all such ratings formulas went with it.

From now on the DAR rating formula will only work with official / officially supported components.




Special thanks go to Yirkha (at Hydrogen Audio) for creating his excellent and elegant component (currently in beta) foo_dynfil.

Any feedback, suggestions, questions visit the DAR thread on the foobar2000 forum at Hydrogen Audio.




Back to the top