Skip to content

louismagowan/lgbm-music_classifier

Repository files navigation

Contributors Forks Stargazers Issues LinkedIn

Music Genre Classification with LightGBM

About The Project

This project tries to classify English language songs from a Kaggle dataset of publicly available music data into their genres. The pre-processing of the data can be run using the prep_kaggle_data.py script or, alternatively, the processed data is avaialble in the zipped csv in this repo (music_data.csv.zip).

Exploratory data analysis of the music data can be found in the eda.ipynb notebook. Exploratory dimension reduction was also conducted using PCA and t-SNE over the lyric features of the songs (which are highly sparse). This was just to get an early indication of how dimension reduction may be useful to the task of classifying the songs into their genres.

For the actual modelling, the lyric data can be reduced to a user-specified number of output dimensions and can be reduced with either PCA, Truncated SVD or a Keras undercomplete encoder.

The modelling itself is done using LightGBM and Optuna, a hyperparamter optimization framework.

A range of output dimensions and Optuna trials were tried with the 3 dimension reduction methods. The strongest performing model overall was one that used PCA to reduce the lyric features into 400 dimensions. It achieved a test macro F1 score of 66.48%.

Feel free to check out the Medium article on this here.

(back to top)

Built With

(back to top)

Contact

(back to top)

Acknowledgments

(back to top)

About

Classifying genres of songs using LightGBM and Optuna

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published