Import Libraries and Dataset
Firstly we need to import Libraries :
- Pandas: To import files/datasets.
- Matplotlib: To visualize the data frame.
- Numpy: To perform operations like scaling and correlation.
- Seaborn: To visualize the data frame.
- Librosa: To visualize the audio data. Install this library by “pip install librosa” command.
Python3
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import librosa.display |
Now to import the data file run the below command.
Python3
music_data = pd.read_csv( 'file.csv' ) music_data.head( 5 ) |
Output :
Music Genre Classifier using Machine Learning
Music is the art of arranging sound and noise together to create harmony, melody, rhythm, and expressive content. It is organized so that humans and sometimes other living organisms can express their current emotions with it.
We all have our own playlist, which we listen to while traveling, studying, dancing, etc.
In short, every emotion has a different genre. So here today, we will study how can we implement the task of genre classification using Machine Learning in Python.
Before starting the code, download the data from this link.
Let’s start with the code.