In order to find songs that are similar to the user’s input song, we initially utilized four similarity metrics: Cosine Similarity, Inner Product, Pearson Correlation, and Euclidean Distance. Since the milestone, we’ve also added Spearman Correlation
and Manhattan Distance as two additional metrics. For each similarity, we find the top-k similar items to the input song, using the 14 features shown above in Figure 4 (excluding “explicit”).
For input handling, we want to solve the “cold start problem” mentioned earlier and still output recommendations even if the input does not exist within our dataset. In order to get the audio features for these new songs,
we use the python library Spotipy to gain access to Spotify’s Web API. Our system can take an input of a list of song titles and artists and retrieve the best match from Spotify library with our own client ID.
To output a coalesced ranked list using the separate metrics, we combine the scores of 6 separate metrics into a single final ranking by averaging them. While test running the combined algorithm, we noticed Pearson and Spearman
were noticeably slower than other metrics and became the performance bottlenecks. To fix this, we implemented K-Means clustering to narrow down the size of the dataset that we apply the similarity algorithm to by splitting it into
8 clusters (default value) and choosing the one that the input belongs to, according to the model.
In implementing the audio feature sliders that differentiate our project from Spotify’s current recommendation system, we want to incorporate a user input to specify custom weights for features. In formulating the code and
approach, we found two interpretations:
1. Users choose which columns are more important or less important for them (e.g. "I want recommendations that, most importantly, have the same level of acousticness as my input song/playlist. ").
2. Users choose which columns they want to change or modify from input (e.g. "I want recommendations that resemble my input BUT an acoustic version with less speechiness. ").
For the users, we believe that both of these interpretations are meaningful. As a result, we implemented both and decided that it can serve as two modes / options for the users in the intended user interface. For the first,
we used the following formula to apply input weights to the similarity metrics:
For the second, we simply translate the input scale of 0-10 on the UI to a value between 0 and 1 and replace the specified column with that value, since our dataset is normalized.