Accompanying blog post: medium.com/p/fe50c94b8af3
After I found out that I have access to some interesting features (danceability, loudness etc) on my Spotify playlists, I decided to crunch some numbers in order to discover patterns on my favorite songs. For reality check, I compared my songs with the Today's Top Hits playlist, leading to some fun observations. You can get the aforementioned features for your playlists by this clever Echonest app.
This repository contains the necessary code, data, and Jupyter Notebooks to estimate histograms, correlation heatmaps, dimensionality reduction and visualization with t-SNE and outlier detection with One-Class SVM visualized in contour plots.
To run you should set up the usual sci-Python gang: Matplotlib, Numpy, Pandas, Seaborn and Sklearn.
- Log in to Echonest app and choose your playlist.
- Copy the table to a spreadsheet.
- Save it as csv.
- Run
spotify_favorites.py
to find correlations and estimate t-SNE and SVM - Run
today_top_hits.py
to compare step's 4. data with today top hits.
To replicate the artist-level projections as seen in my essay, please comment out line 196.
As an alternative to the Echonest app, you can query your playlists directly through the Spotify API, getting access to even more features. Let me know how it went!
Histograms of my playlist's features | Compared to the most popular Spotify playlist |
---|---|
Arcade Fire songs | Belle & Sebastian songs |
---|---|
Contour plot of fitted one-class SVM |
---|