[All work](/work?type=work)

# Music Genre Classification

Ten genres, 5,000 tracks each, and a pipeline that spent more time on the features than on the classifier.

[Source code](https://github.com/Slaymish/Musicical-Genre-Classifier)

University machine-learning coursework. Data preparation, training and exploratory analysis.

![Original correlation heatmap of the music dataset features, including energy, loudness and danceability.](https://cdn.sanity.io/images/qnuj1c4o/production/2b3905449b2a21539c3aef825377ab8fd584c92d-1200x800.png?w=960\&q=80\&auto=format)

The plots came first, as I wanted to see what actually separated the genres before choosing anything, and then the scikit-learn pipeline went in: missing value handling, an artist to genre encoder, one hot encoding, scaling, SelectKBest and PCA, with a stack of random forest, gradient boosting and XGBoost under a logistic regression at the end.

Predictions from the 2024 run are in results.csv, and combined_data.csv is the merged set.

## State

Coursework from September 2024, kept with its figures. Running it again means supplying your own test split, as the one it expects isn't in the repo.

[All work](/work?type=work)
