Script Request: Use Custom Field to Store Calculated Rating

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Script Request: Use Custom Field to Store Calculated Rating

My Rating Formula So Far...

by CriticalTodd » Fri Jun 30, 2006 9:28 am

In case anyone is curious, after much wringing of hands and gnashing of teeth, I've arrive at what I think is a workable formula for my calculated scoring system.

First, I wanted to weigh the overall score to reflect both my rating of the song, how many times it's been played, and when the last time it was played. I ended up with:

50% - Rating
30% - Last Played
20% - Times Played

A couple of notes here: I set the Last Played variable to max out after 45 days. I also compare the title's number played to the title I've played the most to arrive at a relative number.

For the rating, I didn't want to use a straight scale. Instead I wanted to weigh the rating to favor the high rated songs and penalize the low rated ones. To do this, I created an equation in which an 5 star song equated to a value of 1, a 0 star song equated to -1 but where the even point (weighted rating = 0) was at ~3.5 stars.

The formula I arrived at was:

Code: Select all

Weighted Rating = .5*Rating^3 + .5*Rating^2 + Rating - 1
I subtracted 1 to arrive at a percentage value between 100% (5 star) and -100% (0 star).

I then feed this weighted rating into the overall equation to arrive at my weighted score which, for neatness sake, I limit to a number between 0 and 100.

by CriticalTodd » Fri Jun 23, 2006 3:53 pm

Got it. Thanks.

by Steegy » Fri Jun 23, 2006 3:41 pm

The answer has been posted here: http://www.mediamonkey.com/forum/viewto ... 1369#51369

Please don't "crosspost", for everybody's sake. Either (if necessary) continue the discussion here of there please.

Cheers
Steegy

by CriticalTodd » Fri Jun 23, 2006 3:12 pm

Cool.

Do you know how I can set a script to run when a song plays so I can dynamically update the calculated score?

by trixmoto » Fri Jun 23, 2006 2:52 pm

I'm working on another script at the moment, but I will see what I can come up with if I get some time soon. I love the idea though!

by CriticalTodd » Fri Jun 23, 2006 1:45 pm

Hey Trixmoto,

I've taken that other script and used it as a starting point to make something closer to my ideal.

I'm just muddling around though, I'd love to see what you come up with if you decide to take a stab at it!

by trixmoto » Fri Jun 23, 2006 1:25 pm

I really like your idea - not sure if that script is exactly what you want, but maybe it does. If not, I would like to work on this script - mainly because I'd like to use it! :)

by CriticalTodd » Fri Jun 23, 2006 11:13 am

Thanks for the reply. I had not seen that. I'll check it out.

Gratzi!

by Steegy » Fri Jun 23, 2006 10:46 am

Script Request: Use Custom Field to Store Calculated Rating

by CriticalTodd » Fri Jun 23, 2006 10:06 am

I'm throwing this one out to all the scripting gurus out there because, basically, I don't know what I'm doing. There, I've said it.

What I'd like to do is use one of the Custom fields to hold a calculated rating that is a formula, a rough version of which I'll outline below. Once this Custom field is populated, I hope to use it for AutoDJ'ing and other stuff.

I'd like the calculated rating to reflect not only how I rate the song but also how many times it's been played and how long ago it was last played. I'd like to take these bits of information, churn it up, and spit out a rating that will reflect songs that I like that I haven't heard often and/or in a long time.

The formula would look something like this:

Calculated Rating = (Rating * Last Played) - Times Played

So that if I had three songs:

Song A - Last Played: 30 days ago; Times Played: 10; Rating: 5*
Song B - Last Played: 1 day ago; Times Played: 1; Rating 4*
Song C - Last Played: 60 days ago; Times Played: 30; Rating 2*

The calculated ratings would be:

Song A - 140
Song B - 3
Song C - 90

I've tried setting up various filters to create this sort of scoring system but each of my attempts seems to fall short on one thing or another.

If anyone has some scripting love out there, I'd appreciate it.

Top