Automatically Rate songs - iLounge Forums
Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.

Topic: Automatically Rate songs

Reply Thread Tools Topic Search
Old 09-13-2006, 09:44 AM
#1
 
Freshman Lounger
 
Join Date: Sep 2006
Posts: 12
Automatically Rate songs

I don't know about anyone else, but when I first started using iTunes a few years back, but most useless feature in my opinion was the ratings system.

First, there's the problem of rating all the songs in the first place. It's often hard to put a song on a 5 star scale.

Second, what happens over time? Let's say you got a song that you really loved. Of course you'd rate it 5 stars. But after 2 weeks of playing it 3 times a day, I don't think you'd view it as highly. Even relative to the rest of your songs, it may no longer deserve 5 stars. So now you have to go back and re-rate songs as you listen to them?

And then there's people like me. I have over 5000 songs. I'm sure this isn't a rare number of tracks to have in your library. I bet there are people reading this how have over 7000. Even 1000 tracks is too many to rate and then subsequently re-rate.

So I've written a windows program that automatically rates all your songs based off how frequently you play them (NOT the same as play count number). You can thus rate your songs on recent popularity, or you can also create a rating that is a mix of recent popularity and overall play history to come up with an overall rating. You can run it every few days to reevaluate the current ratings. I'm still in the process of tweaking it, but if anyone would like to try it, message me. Also, if anyone has any suggestions about factors to take into account when building the ratings, let me know and I'll see if it fits into the current script.

Last edited by ChipT; 09-13-2006 at 10:19 AM.
ChipT is offline  
Reply With Quote
Old 09-13-2006, 10:16 AM
#2
 
Junior Lounger
 
Join Date: Aug 2006
Posts: 29

Sounds like a good idea. I don't think I would use it though.
I have to many smartplaylist to get a good shuffle of my libarary and ratings play some role in that system.

What I would like to see is a script that can parse billboard top 40 and see if I have the song and rerate them and tag a comment saying top 40 week of ______.

Keep developing.
deweyii is offline  
Reply With Quote
Old 03-09-2007, 05:40 AM
#3
 
Freshman Lounger
 
Join Date: Sep 2005
Posts: 19

I'm interested...but when you say the ratings are based on how frequently you play them, does that mean how frequently you choose them to play manually? Or just how often they play from the time I start using the script?
Skyline_Evo8 is offline  
Reply With Quote
Old 03-09-2007, 06:00 AM
#4
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142

Very interesting concept to implement to a tool. To rate a song, we need to figure out the variables involved. What can they be? Played Count, How many days past since the last played date, anything else?

We will need to come up with a formula that takes these variables and produces a 1 to 5 value. This can be the Rating. This way, even a song that was played over 300 times, with days passes by without playing it, will have Rating decreased.

Played Count is directly proportional to Rating.
Today() - Last Played Date is inversely proportional to Rating.

Ideally iTunes should be doing by itself.

Once again very interesting concept to put into code.



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 03-10-2007, 02:31 AM
#5
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142

I have an implementation of the auto Rating system and this is how it looks in my Top 25 Most Played smart playlist.

Click the image to open in full size.

Considering PlayedCount, Last Played Date and Date Added, what do you guys think?



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 03-31-2007, 06:26 PM
#6
 
Reclined Lounger
 
Join Date: Dec 2005
Posts: 299

Sorry for going slightly off topic, but how the heck have you managed to get songs rated in 1/2s ? Is this a feature of the latest iTunes upgrade that I haven't yet downloaded???
oobujoobu is offline  
Reply With Quote
Old 03-31-2007, 10:10 PM
#7
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142

oobujoobu,

It is possible to do it programmatically. If you are interested in the add-on I have posted a thread about it in iTSfv - iTunes Store file validator

Cheers,
McoreD



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 04-01-2007, 11:12 PM
#8
 
Freshman Lounger
 
Join Date: Apr 2007
Posts: 1

Quote:
Originally Posted by ~*McoreD*~
Considering PlayedCount, Last Played Date and Date Added, what do you guys think?
Interesting idea.

Something I'd be very interested in, namely because of the massive amount of music, and the lack of time to rate them, let alone do it in any consistant way!

The only real thing I could think to add ontop of that would be to factor in Skip Count in some way. At the time of writing I have no knowledge at all of scripting, so no idea at all how difficult any of this is!

A thread to be watched, for sure

Phoenix
NorthernPhoenix is offline  
Reply With Quote
Old 04-09-2007, 08:27 PM
#9
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142

Click the image to open in full size.

Have factored in Skipped Count in the latest beta and my Top 25 Most Played smart play list is above.

Noticed most of the tracks have their My Rating decreased with time as I haven't played them.

I haven't skipped much tracks and I only used 10% weighting for the skipped count so

Click the image to open in full size.

didn't see it affecting my rating that much. But if you increase the weighting as shown in the Options window above or have skipped tracks a lot, then you will see its effect.

Cheers,
McoreD



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 04-30-2007, 08:51 PM
#10
 
Freshman Lounger
 
Join Date: Sep 2006
Posts: 12
Good Stuff

Hey McoreD, I like the look of your version. It seems very transparent (the user can understand what goes into the ratings system) which is a good thing.

I'm curious how you chose to implement the Skip count. I considered adding that variable to my program, but decided it might skew the results. Basically, if a song is getting skipped, it's also not getting played. If ratings naturally decay over time, skipping a song is like double-counting. You are accelerating the rate of decay. And if you change tracks during a song you really like, that doesn't imply that you don't like it as much or that you believe the song deserves a lower rating.

And a secondary point that I've realized since using my program is that it may change your behavior. At least for me, I realize that if I don't complete a song, iTunes won't increment the play count. So even if I like the song I'm listening to, but then I suddenly want to change songs, I might desire to give that song "credit", but it won't get that recognition if I switch tracks. I wish iTunes would increment the play count if a certain percentage of the song were played. But that's not a huge issue.

Another thing that differs between our versions is that I did not include the Date Added. The reason is I first came up with this idea after I had accidentally deleted my iTunes library (the iTunes info, not the music files). Anyone who has experienced this knows that iTunes stores the play history info separately from the music files (a fact that should have been obvious to begin with, but you don't think about when you're reinstalling your OS). So I ended up with 5000+ songs all added on the same date. Hardly seemed fair to rate songs using that basis.

And at the same time, implementing a ratio of Play count to Date Added seemed incorrect because a song that I play 5 times today but have had for a month may get a lower rating than a song I play 3 times today but added today. I suppose it's all in the weightings, but I didn't think a song should be "punished" for being around longer.

But I like bouncing ideas around. Please disagree vigorously.
ChipT is offline  
Reply With Quote
Old 05-01-2007, 03:06 AM
#11
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142

ChipT, thanks for responding.

Skipped Count was used with a simple concept of "play rate".
scoreSkippedCount = playedCount / (playedCount + skippedCount)
For example, if you played a song 50 times and has skipped the song 4 times then the play rate will be 50/54 which is 92.59% which will then get weighted against the % specified by the user. This way I expect the negative effect from skippedCount to be minimal. I agree completely with saying that skippedCount is accelerating the decay of My Rating for a song. Having this in mind, from the beginning, the weighting is allowed for the user to rate the song according to their personal taste. So for example, if you don't require skippedCount taken in to account, you can complete turn that off by setting 0% weight to it.

When you start playing a song in iTunes, one of three things is destined to happen:
* The Play Count will increment by one.
* The Skip Count will increment by one.
* Neither count will increment.
From your secondary point, I get the impression that your program has the ability to rate the song even if the song is not fully played. That's impressive, and a very nice/smart feature to have.

It seems you have misinterpreted how DateAdded is used in iTSfv rating system. Song should NOT or will not be "punished" for being around longer. What happens is exactly the opposite. Say you added a song in January. You add another song in April. Both had a play count of 10, yesterday. You play both songs today. So now the play count of both songs will be 11, right? However, one song is older than the other, and you still had the preference to play it today! So what happens? The older songs is favored more during the rating.

I see your point about re-adding all songs to the library in a single day. What will happen then is that all songs will be treated equally during the rating according to what I explained in the above paragraph.

Developer discussion is fun. Keep the ideas bouncing.

Thanks,
McoreD



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 05-02-2007, 09:19 AM
#12
 
Freshman Lounger
 
Join Date: Sep 2006
Posts: 12

So that 92.59% is like hit ratio. How many times did you play the song through given how many times it came up. Interesting. I suppose one could say that you like a song more if you play it every time it comes up versus one you play on 50% of the time when it comes up. I'll have to think about that a bit more.

And you misunderstood. I wish I could figure out a way to include how much a song was played, but the closest thing to that is the skip count. But skipping a song because you don't like it is different from playing 90% of a song and changing tracks, so I can't use skip count for that purpose.

On DateAdded, that's an interesting way to use it. Though what if the older song had 0 play counts? It may as well be a new song. So between a song that was added today with a play count of 1 and a song that you've had for a year and just played it for the first time, does the older song deserve a higher rating? I guess it could be argued both ways. But because you allow your user to control the weightings, it can be tweaked.

How did you determine how quickly ratings should fall?

In my program, I have two different ways of rating the songs. The first rates solely on recent plays (play counts that occured within the last 45 days I think). The program creates a second file that saves play history, so it can keep track of how often a song is played, not just when it was last played and how many times it's been played overall. Songs that are played today receive a boost in rating. That rating decays over time to 0 over the course of the 45 days. Songs that haven't been played in the last 45 days have no rating.

The other method rates songs based on a combination of overall play count and recent play history. So songs that have been played the most have the highest ratings, but they can be trumped by a song that's been played more recently. There are weights to manage this. So a song that was played today with a play count of 1 won't get a higher rating than a song with a play count of 40 that hasn't been played in 3 months. But (and I forget the weights right now), maybe after it has been played 10 times in 2 days, it will get a higher rating than that 40-count song. And as quasi-explained earlier, the more frequently a song is played recently, the higher the rating.

The one thing I grappled with was the relative status of the rankings. How do you spread out the ratings so that there isn't an overabundance of 1 star songs or a overabundance of 5 star songs. I ended up putting some exponential formula together to spread it out. But I'd have to go back and look at it more closely to explain it. It's been a while.
ChipT is offline  
Reply With Quote
Old 05-02-2007, 11:10 AM
#13
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142
Thumbs up

Thanks for the email with the program. I very much liked the stats part in there - that was a surprise!


Top 10 artists:
Rankings based on a combination of recent play count and overall play history
Scores are out of 100

1. Sean Paul ( 100 )
2. Cassie ( 96 )
3. TiŽsto ( 80 )
4. Needless To Say ( 77 )
5. Aman Hayer ( 65 )
6. iiNet ( 64 )
7. Indra ( 59 )
8. Soundtrack ( 56 )
9. Dr. Zeus ( 52 )
10. Armin Van Buuren ( 49 )

Top 5 genres:
Rankings based on a combination of recent play count and overall play history
Scores are out of 100

1. R&B ( 100 )
2. Reggae ( 98 )
3. Bhangra ( 95 )
4. Trance ( 85 )
5. Pop ( 83 )

So that 92.59% is like hit ratio. How many times did you play the song through given how many times it came up

That's a nice way of putting it.

Though what if the older song had 0 play counts? It may as well be a new song. So between a song that was added today with a play count of 1 and a song that you've had for a year and just played it for the first time, does the older song deserve a higher rating?

Yes the older song will deserve a higher rating but again how much it deserves, depends on the weighting the user puts.

How did you determine how quickly ratings should fall?

Much like yours. This is what's been happening behind the scenes.

Code:
  Public Sub sEditTrackRatingV4(ByVal track As IITFileOrCDTrack, _
                        ByVal mWeightPlayedCount As Integer, _
                        ByVal mWeightSkippedCount As Integer, _
                        ByVal mWeightLastPlayed As Integer, _
                        ByVal mWeightDateAdded As Integer, _
                        ByVal mMaxPlayedCount As Integer)

        If track.PlayedCount > 0 Then

            Dim playedCount As Double = track.PlayedCount * (track.Duration / mAvgTrackDuration)
            Dim skippedCount As Integer = track.SkippedCount
            Dim daysSinceLastPlayed As Double = Now.Subtract(track.PlayedDate).TotalDays
            Dim daysSinceAdded As Double = Now.Subtract(track.DateAdded).TotalDays

            Dim scorePlayedCount As Double = playedCount / mMaxPlayedCount
            Dim scoreSkippedCount As Double = playedCount / (playedCount + skippedCount)
            Dim scoreLastPlayed As Double = (playedCount - daysSinceLastPlayed) / playedCount
            Dim scoreAdded As Double = (daysSinceAdded - daysSinceLastPlayed) / daysSinceAdded

            Dim ratingScore As Double = mWeightPlayedCount * scorePlayedCount + _
                                        mWeightSkippedCount * scoreSkippedCount + _
                                        mWeightLastPlayed * scoreLastPlayed + _
                                        mWeightDateAdded * scoreAdded

            Dim intRating As Integer = Math.Round(ratingScore, 0)
            track.Rating = intRating

        End If

    End Sub
A trick is in scoreLastPlayed. If a song is played 50 times as of today and 5 days pass by without playing the song then the scoreLastPlayed will be 45/50 = 0.9. After 10 days it will be 40/50 = 0.8. The rating decay was implemented that way. If it hasn't played for last 50 days then scoreLastPlayed will contribute a score of 0 to the overall rating score.

How do you spread out the ratings so that there isn't an overabundance of 1 star songs or a overabundance of 5 star songs.

Once again I am guessing the weighting has taken care of possible overabundances.

I like the way how you keep a history in an XML file so that the more day passes by, the more accurate My Rating becomes.



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote
Old 05-03-2007, 04:52 PM
#14
 
Freshman Lounger
 
Join Date: Sep 2006
Posts: 12

Yes, it is nice that the ratings theoretically get more accurate the more you use it. It'll even compensate if you don't use it for a couple of days. It will see how many times you've listened to a song since the last time you ran the program, and it will assume that those plays were spread out evenly over that period of time. That way it doesn't read them as all having happened at once on the day you ran the program. This would artificially inflate the ranking.

Of course the negative side of this is that I almost feel like I'm doing a disservice to the accuracy of my rankings if I don't use the program often enough.

I'm curious, how did the rankings from my program compare to what you calculated in yours?
ChipT is offline  
Reply With Quote
Old 05-03-2007, 09:23 PM
#15
 
Senior Lounger
 
Join Date: Oct 2003
Location: Australia
Posts: 142
rTunes

Have run rTunes two times so far.

rTunes - My Top 25 Most Played 2007-05-02

Click the image to open in full size.

rTunes - My Top 25 Most Played 2007-05-04

Click the image to open in full size.

rTunes - Top (25) Rated 2007-05-04

Click the image to open in full size.

The Ratings are indeed spread out well as you like it to be. To my taste, I prefer ratings not to reflect my played count a bit more - this is with rCombo. Then again that's just me.

iTSfv - My Top 25 Most Played 2007-05-04

Click the image to open in full size.

iTSfv- Top (25) Rated 2007-05-04

Click the image to open in full size.

As you see from the screenshots, you see I have punished songs a lot (with the default rating weightings).

Really curious and hope you post your My Top 25 Most Played and My Top Rated smart playlists screenshots too withthe iTSfv link in my reply email. Load up iTSfv, go to Advanced.



Some FYI:
Saying CDís for more than one CD is wrong. Say CDs.
A 500 GB hard disk has capacity for 465 GiB of data
International standard date notation is yyyy-MM-dd
~*McoreD*~ is offline  
Reply With Quote

Topic: Automatically Rate songs

Reply Thread Tools Topic Search

Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



RSS Feed Widget

iLounge Weekly
News, reviews, articles, giveaways, deals, and more delivered to your inbox.
Sign up for the iLounge Weekly Newsletter

iLounge is an independent resource for all things iPod, iPhone, iPad, and beyond.
iPod, iPhone, iPad, iTunes, Apple TV, Mac, and the Apple logo are trademarks of Apple Inc.
iLounge is © 2001 - 2016 iLounge, Inc. All Rights Reserved. Terms of Use | Privacy Policy