I have never been one to create music playlsits on Spotify. Most often, I don't want to take the time to create playlists and on the rare occasions I do attempt to make a playlist, I can't decide how I should structure my playlists. Therefore, any song I like ends up in the 'Liked Songs' list with the rest of my 500+ saved songs. I was interested in exploring unsupervised learning methods as a possible solution.
Objective: Use a K-means clustering algorithm to separate my songs into playlists. The goal is create playlists that appear to be logical in terms of song similarity. Use the Spotify API to create Spotify playlists in Python.
You can find the main steps of the K-Means clustering process below.
The Elbow method was used to select the optimal number of clusters. (Select k where the Within-Cluster-Sum of Squared Errors starts to diminish, or where the curve begins to level out.) A k value of 5 was chosen for this application.