A few weeks ago I came across with an interesting article titled “A Music Taste Analysis Using Spotify API and Python”. In this article, an author tries to analyze not only his but also a fiancée’s preference to determine what the data has to say about this. Thus, he compares two different profiles in terms of music features, which are provided by Spotify’s API, simultaneously. While reading it, I was curious to not only analyze my own preference but also to play with my Spotify data. Therefore, I wanted to cluster my saved songs on Spotify into separate playlists that would represent a specific mood I have while listening to them.

So in order to accomplish my task I broke down my goal into few separate tasks:

  • Acquire Data
  • Build a clustering model
  • Find out an appropriate classifier and train on the data acquired
  • Classify my songs and separate them into playlists
  • Classify recommendations

Initially, it is worth mentioning that likewise Twitter, Slack, and Facebook Spotify offers an API for developers to explore their music database and get insights into our listening habits. It provides a large variety of features; however, I used 8 features describing a song.

  • Acousticness value: “describes how acoustic a song is”.
  • Danceability value: “describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity.” Thus, I decided not to use tempo since I believe this feature was derived from them.
  • Liveness value:_ “describes the probability that the song was recorded with a live audience”._
  • Energy value: “represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy”.
  • Instrumentalness value: “predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal”. The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content.”
  • Loudness value: shows how loud music is.
  • Speechiness value:_ “detects the presence of spoken words in a track.”_

**For more information on different features provided: **Get Audio Features for a Track | Spotify for Developers

#artificial-intelligence #music #machine-learning #spotify

Cluster Your Liked Songs on Spotify into Playlists of Similar Songs
5.35 GEEK