Spotify Metrics. Do you know them?

Posted on Jul 29, 2019


ย  ย  ย When listening to music on Spotify, you're likely not thinking about how your favorite streaming service categorizes each song on various characteristics. In fact, who knows what kinds of song traits there might be without formal music theory training? Spotify measures each song on features such as danceability (how suitable a track is for dancing), energy (the intensity and activity of a song), and valence (how happy a song makes you feel) among a host of other metrics geared towards an algorithm compatible with user preferences. By exploring these measurements Spotify determines, we can begin to understand what features are related towards driving music that's considered happy and popular.


When opening the app, you'll be starting at the home page, which outlines the 10 genres with the highest average valence, alongside information detailing the most popular song and the most popular year before 2000.


Dataset + Methodology

Spotify offers an API for developers that allows for extraction of this data for existing songs. However, the dataset used for this app consists solely of Billboard 200 songs in the database since the early 1960s. A glossary of all metrics used in Spotify's analysis can be found here. In an effort to explain uncharacteristic observations, I primarily have analyzed the following variables: valence (how happy a song makes you), popularity (how popular a song is considered to be), speechiness (valuation of spoken word by song), and instrumentalness (lack of vocalness, otherwise interpreted as acousticness).

The app is designed to explore relationships and trends between these four variables, in addition to providing an analysis of what other Spotify measures are correlated with them.ย 


On the last tab of the app, the user can explore and filter the data based on the search field, if anything in particular strikes them further.


The App + Findings


The app's second tab, Year, begins with a visual time-series line graph showing the average valence and popularity by year for the entire dataset.

Scrolling down on this same Year tab, can explore the same relationship between speechiness and instrumentalness.

We can see that both valence and instrumentalness trended downwards over time, while popularity and speechiness increased. Have songs become more lyrical over time? Why would music today convey less happiness than it used to?


The explore tab allows the user to look at where each unique input of their own stands in relationship to its average valence/instrumentalness and popularity/speechiness. Categorizing similar trending variables over timeย  give the user an idea of what effect unique values that match their personal preferences may have on the overall standing within the subset of data they choose to evaluate.


The final interactive tab takes outlines correlation coefficients for the four variables we graphed in the year tab. The user can hover over each point to find the coefficient value and determine what variable is measured against our four of interest.

In reviewing this tab, there are irregularities we would assume to be false given what we had seen in the time-series graph. The exact same three variables (energy, danceability, and loudness) are most highly rated for both valence and popularity, which we've seen move in opposite directions in the Year tab. Valence and popularity are also least correlated with acousticness, which as expected is most correlated with instrumentalness. Other characteristics are open for exploration by the user simply by hovering over the points or looking at the legend.

Future Work

This plot presents an analysis of correlation that opens the door for additional analysis into causation for our variables of interest, something correlation can't imply. As I develop this app, I look to provide additional insight into our time-series trends. For now, we can begin asking if lyrics make songs more popular? Does acousticness and pure sound convey happiness? Whether it's yes or no, why?

The skills the authors demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

About Author

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI