Bhavika Tekwani
Given audio features for a song, can we predict what mood the song represents?
Do audio features help with mood identification?
Million Song Dataset | Spotify API |
---|---|
Artist, Song title | Speechiness |
Duration | Energy |
Loudness | Acousticness |
Key, Mode, Time Signature | Instrumentalness |
Tempo | Danceability |
Segments Pitches (Chroma features, 2D) | |
Segments Timbre (MFCC + PCA, 2D) Beats |
Hand labelled 7396 songs as 'happy' and 'sad'. Train test split is 60/40.
Low Level Segment Features
Timbre
Pitch
Descriptive Features
Speechiness, Danceability, Tempo, Loudness, Energy, Acousticness, Instrumentalness
Notational Features
Key, Mode,
Time Signature
Recursive Feature Elimination with Random Forest Classifier and 5 fold cross validation
Used 25 of a possible 52 features
Compared feature importance by model
Most important descriptive feature was Danceability, followed by Energy, Speechiness and Beats
Model | Features | CV score | Test accuracy |
---|---|---|---|
Random Forest | Segment + Desc | 73.33 | 75.44 |
Segment | 71.73 | 73.13 | |
XGBoost | Segment + Desc | 73.33 | 75.24 |
Segment | 71.73 | 73.10 | |
Gradient Boosting | Segment + Desc | 72.65 | 74.39 |
Segment | 71.12 | 72.87 | |
Extra Trees | Segment + Desc | 68.44 | 73.86 |
Segment | 68.14 | 71.81 | |
SVM | Segment + Desc | 73.33 | 73.26 |
Segment | 71.81 | 69.97 |
Visualization: Seaborn, Matplotlib
Models: Scikit-Learn, XGBoost, Pandas, Numpy
Spotify API wrapper: Spotipy
Data Wrangling: SQL