Statnik 2: Musical Neighbor Boogaloo

Published: July 24, 2017

statnik

Hello comrades, and welcome to sputnikmusic, the music vertical for the Russian propaganda news site sputniknews.com. Today we will cover a long lost feature of sputnik, musical neighbors. First, anybody that visits this site loves music. Sometimes users come onto this site and celebrate their favorite artists and the albums of theirs that they love. Sometimes they come to trash someone else’s favorite artists and albums but also because they love music. It takes a special love to spend one’s time and mental effort listening to music they know they won’t like, and a special love to come up with a long string of sick one-liner put-downs. We share this love with each other, as fellow chum, in all its forms; but it is true that our love of music can align more strongly with an exclusive subset of individual users: our musical neighbors.

From the list on this topic that I did a while ago, I gather that musical neighbors was a fun, well-regarded feature of the site, even though no one knew what the hell it was or how the hell it worked. (I recall being told that almost everybody was connected to one particular user.) It’s obvious why it was so popular; it’s because it made us feel connected to others and feel bigger than ourselves. It made us feel connected to the whole of sputnikmusic, the music vertical for the Russian propaganda news site sputniknews.com. With this post, I will return that shared love back to sputnik, as well as give you the tools to seize the means of production of musical neighbors for yourself.

**Harsh vox** I want to be your neighbor

**Harsh vox** I want to be your neighbor

“Musical neighbors” can be calculated in various ways. Armed with a set of users’ ratings, you could do any flavor of correlation coefficient, distance metrics, or a variety of statistical models to calculate musical neighbor-dom. For simplicity, I will be using a distance metric, cosine similarity. It is a value between 0 and 1 that measures, in simplified mathematical speak, how close in direction, in this case, the ratings between two users are. A 1 is perfect similarity, and a 0 is no similiarity. (If you want more details about cosine similarity, for some reason, go here.) It’s fairly simple and quick to calculate, so it will be our tool for human unification.

I will be working in R again, and I will refer you to my previous post about how to install it. If you haven’t already, you will need to install the packages ‘dplyr’ and ‘XML’ like so.

install.packages(c(‘dplyr’,’XML’))

Then, copy the code from the following page of my github into a text editor.

Replace the “user <- ‘macman76’” with whatever user you want musical neighbors calculated for (so, probably your username, i.e. user <- ‘differentuser’). The username needs to be the one that can be found on the url link of the users’ profile page (i.e. www.sputnikmusic.com/user/macman76, get the last part of the url, “macman76”). Then, the “neighbors” object (which, by default, is a list of all the staff/contrib/emeritus users of sputnik) can be whomever you want to be compared to. You can list as many users as you want. The name has to be the profile page name as I said before, they have to be surrounded by quotation marks or apostrophes, you have to separate each user with commas, and, finally, you have to surround the user list with a “c” and opening and closing parentheses and assign it to the “neighbors” object (i.e. neighbors <- c(‘user_1’,’user_69’,’user_niiiiicccce’)). Once all that’s done, copy it into the R console and hit enter/return.

With the default settings of the code, it takes about 2 minutes to run on my mid-level performance laptop, and it takes up about 35 megabytes of network data. When you run the code, you will be given a list of your 10 closest musical neighbors, specifically their ranking, name, and cosine similarity score. A similarity of 1 means that you have the exact same ratings as your neighbor, a 0 means you have no alike ratings, and somewhere in between is degree of how close the ratings are. Your cosine similarity increases the more ratings you share (as in, the more common albums that you and your neighbor have rated) and the closer your shared ratings are (like when you both succumb and 5 TDAG). After running the script, if you want to view every similarity and not just the top 10, run the following code.

print_neighbors(dat$neighbor_scores,user,length(dat$neighbor_scores))

Now, these posts are not only meant to be educational and fun, they are emotionally-driven narratives of staggering artistry. Beautiful narratives require things to change – dramatic rising action. To satisfy this, I ran the algorithm twice: once with my original ratings (before I started this post) and once after like 10 minutes of fumbling across the site rating things I should have long ago. Here is the before

Top 10 Musical Neighbors for macman76
Rank 1, hogan900, score 0.159
Rank 2, TalonsOfFire, score 0.152
Rank 3, Insurrection, score 0.144
Rank 4, JViney, score 0.138
Rank 5, Trebor., score 0.130
Rank 6, Mongi123, score 0.128
Rank 7, DoofusWainwright, score 0.126
Rank 8, ExplosiveOranges, score 0.119
Rank 9, Irving, score 0.118
Rank 10, Iai, score 0.116

…and after.

Rank 1, Insurrection, score 0.189
Rank 2, hogan900, score 0.181
Rank 3, TalonsOfFire, score 0.174
Rank 4, Mongi123, score 0.171
Rank 5, ExplosiveOranges, score 0.144
Rank 6, IsItLuck%3F, score 0.144
Rank 7, GnarlyShillelagh, score 0.140
Rank 8, Trebor., score 0.140
Rank 9, Mikesn, score 0.139
Rank 10, JViney, score 0.131

No top 10 neighbor remained in his/her (but mostly his, right?) ranking and 3 users dropped out entirely.

Because this code will only compare you to the users you feed into it, your most musical neighbors may not be users you selected or even users you are familiar with. My own neighbors show that one’s most musical neighbors may be a different set tomorrow. You’ll grow and you’ll change, and the cosine similarity between you and everyone else will change, too. Never forget, though, comrade, that the cosine similarity of our humanity is closer to 1 than 0.

Sputnik users of the world, unite!

Pop / Top 40 / General
follow us on Twitter      Contact      Privacy Policy      Terms of Service
Copyright © BANDMINE // All Right Reserved
Return to top