Exploring the Web of Sound

Full Last.fm user-artist network

Music taste feels personal, but most of the music we listen to is discovered through other people. Friends recommend artists, online communities form around genres, and one artist can lead you toward another. I wanted to see whether some of those patterns would actually show up in listening data.

Using the Last.fm API, I created a network connecting listeners to their most played artists. I started with my own account and used snowball sampling through connected users until I had data from 1,000 listeners and each user's 10 most listened-to artists.

Building the Network

I structured the data as a bipartite network, with one group of nodes representing users and the other representing artists. The connections between them were weighted by how many times each user had listened to that artist. I also collected attributes including users' total play counts and number of unique artists, along with artists' genres and total Last.fm listeners.

Before running the analysis, I removed nodes with missing attribute data, isolated nodes, and users with very little listening activity. I then projected the original network into separate user and artist networks. This let me move from simply seeing who listened to what toward comparing relationships between listeners and between artists.

How Do Listeners Group Together?

Last.fm user network projection

The user projection connects two listeners when they share artists. One of the first things I tested was assortativity, which measures whether similar nodes are more likely to connect to one another.

User degree assortativity was 0.36, the strongest assortativity result in the project. This suggests that highly connected listeners tended to share music with other highly connected listeners, while users with more niche listening patterns also tended to group together.

Popular and Niche Artists

Last.fm artist network projection

The artist projection produced a slightly different picture. Artists had a listener-count assortativity of 0.18, meaning that highly popular artists were somewhat more likely to appear near other popular artists, with a similar pattern among more niche artists.

At the same time, artist degree assortativity was -0.11. That was interesting because it suggests that individual listeners still mix popular and niche artists together rather than staying completely inside one level of popularity. Genre assortativity was also positive at 0.12, showing that artists with similar genre labels were somewhat more likely to be connected.

Comparing Different Types of Importance

User centrality correlation heat map

I also compared several centrality measures to see whether they were identifying the same kinds of important nodes. I looked at closeness, betweenness, eigenvector centrality, and weighted degree.

In the user network, weighted degree and eigenvector centrality had a 0.95 correlation. In this network, users with strong connections to many artists were also very likely to be connected to other structurally important users.

Betweenness had weaker relationships with those measures. So being highly connected did not necessarily mean that a listener served as a bridge between different groups of users.

Artist centrality correlation heat map

The artist network behaved differently. Here, betweenness and weighted degree had a correlation of 0.89. Highly connected artists were also much more likely to act as bridges between different parts of the network.

I liked this comparison because it showed why using several measures was more useful than just ranking every node by one definition of importance. The same metric could mean something different depending on whether I was looking at listeners or artists.

Do Music Communities Match Genre?

Genre distribution within Louvain communities

My final question was whether communities formed from listening behavior would resemble recognizable music genres. I ran the Louvain community detection algorithm on the artist network and found 11 communities with a modularity score of 0.46.

I then looked at the genre distribution inside each community. Some of the groupings were pretty clear: one community contained a large number of metal subgenres, another leaned heavily toward rap and R&B, another toward indie rock and folk, and another toward soundtrack and video game music.

Artist network colored by Louvain community

This visualization shows the artist network colored by the communities detected by the Louvain algorithm. The communities were created from shared listening behavior rather than genre labels, which made the overlap with recognizable genres especially interesting.

Genre clearly isn't the only thing shaping music taste, and the communities still overlap with one another, but the results suggest that genre is reflected in the way listeners move between artists.

What I Took Away From the Project

This project gave me a chance to work through almost every part of an analysis: collecting data through an API, cleaning and restructuring it, choosing statistical methods based on specific questions, testing relationships, building visualizations, and deciding what the results actually meant.

It also showed me how much the way you collect data can affect what you eventually find. Because I collected exactly 10 artists for every user, I introduced some artificial regularity into the network. If I continued the project, one of the first things I would change would be allowing the number of artists per user to vary. I would also add actual Last.fm friendship connections so I could compare social relationships directly with similarities in music taste.

What I found most interesting was seeing things I normally think about more casually, like mainstream versus niche music, genre communities, and artists that connect different audiences, actually emerge as patterns in the data. On a larger scale, these patterns show how something as individual as listening to music can reflect broader social structures, with thousands of personal listening choices coming together to form distinct communities and connections.