Skip to content

Spotify Rock Music Genre Classification using Machine Learning ๐ŸŽธ

Notifications You must be signed in to change notification settings

RafaelJMinaya/Spotify-Music-Genre-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Spotify Music Genre Classification ๐ŸŽธ

0. Project Overview

This project aims to develop a machine learning classification model that accurately identifies tracks labeled under the "Rock" genre and assigns them to their correct genres. The primary goal is to address the common issue of genre mislabeling, where tracks tagged as "Rock" may span various subgenres or even belong to entirely different musical categories. By utilizing a dataset of audio and music categorical features, this project will apply supervised learning techniques to improve genre classification accuracy, helping to refine the categorization process and ensure that "Rock" songs are appropriately classified according to their actual sound. characteristics

genre-pitch-your-single-to-spotify-playlist-curators

Key Steps:

  1. Data Cleaning: Removed duplicates and missing values for better data integrity.

  2. Exploratory Analysis: Examined the distributions of song features like danceability, energy, and tempo, and visualized genre popularity and correlations between features.

  3. Genre Popularity: Analyzed the most and least popular genres based on song popularity.

  4. Modeling: Built and evaluated classification models, such as Random Forest, to predict whether a song belongs to the "Rock" genre based on its features.


1. Data Overview

Spotify Song Dataset:

Comprised of 114k songs from Spotify with genre categories for each song


Dataset:

image

Column Info:

image

Summary Statistics for Quantitative Columns:

image


2. Exploratory Analysis

Histograms of Numeric Features:

image

Correlation Matrix:

image

Value Count for Each Genre:

image

Top 10 Most/Least Popular Genres (By Average Popularity):

image

image

50 Most Popular Rock Songs:

image

image


3. Data Preprocessing

Preparing Features:

image

Features & Labels:

image

image


4. Multi-Model Evalutation

Training and Performance Metrics w/ Default Parameters:

image

From a simple overview of model performance, each of our models is doing a great job; however, let's take a closer look into the accuracy of predicting certain labels.


Random Forest Classifier:

image

Gradient Boosting Classifier:

image

K-Nearest Neighbors:

image

K-Nearest Neighbors provides the strongest precision score when predicting values that fall under the "Rock" genre compared to the other tested models, so we'll work with this model and improve its precision even more in predicting values under the "Rock" label.

Hyperparameter Tuning

image

Setting our n_neighbor parameter to 4 we get the results below

image

image

About

Spotify Rock Music Genre Classification using Machine Learning ๐ŸŽธ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published