Home Dataset Methods and Results Analysis

Dataset

Getting the data

We compiled our dataset, consisting of 1,321 songs and 7 genres, from a number of genre-based Spotify playlists. These genres include country, pop, rock, r&b, jazz, hip-hop/rap, and edm. To ensure accuracy, we mostly used playlists generated by Spotify, and the genre classification for each track was determined by which playlist it came from. We used a couple genre-based playlists not generated by Spotify, but we manually reviewed these to make sure they were accurate. We also eliminated duplicates from our final dataset. We tried to achieve an even distribution among genres, and the exact distribution can be seen in the chart below.
distribution

Number of songs of each genre in our final dataset.

We used Spotify's API to extract metadata for each song to obtain the following attribute values: danceability, energy, key, loudness, mode, speechiness, acousticness, instrumentalness, liveness, valence, tempo, duration, timbre, and pitch. We eliminated time signature from our feature list because almost every song in the training data (and in general for the population we are looking at), has a time signature of 4/4.

Attributes

acousticness dancability
enery speechiness
valence instrumentalness

Boxplots showing the data ranges for select attributes. These graphs give us an idea of which attributes may distinguish genres the most. For example, jazz and country seem to be the most acoustic, jazz songs typically have longer duration, edm has higher engery, rap has more speechiness, etc.

All attributes except timbre and pitch are within the range of 0 to 1. Timbre and pitch are actually 12-value vectors. The Spotify API provides a 12-value vector for timbre and pitch for every segment of the song (typically only up to a couple seconds long). There are clearly too many timbre and pitch values per song to directly pass into these classifiers, so we instead found the average value for each component of the timbre and pitch vectors for each song.

Northwestern University EECS 349