Click4Ai

544.

Medium

Music Genre Classification

In this problem, you will use a machine learning approach to classify music tracks into different genres. You will need to use a pre-trained model and fine-tune it on a dataset of labeled music tracks.

**Example:** Given a music track, predict its genre.

**Constraints:** The input music track is a 30-second MP3 file, and the model should output a probability distribution over 10 genres: rock, pop, jazz, classical, hip-hop, electronic, folk, country, R&B, and metal.

**Note:** You can use the Librosa library to load and preprocess the audio data, and the Scikit-learn library to build and train the model.

Test Cases

Test Case 1
Input: music_track.mp3
Expected: rock
Test Case 2
Input: music_track2.mp3
Expected: pop
+ 3 hidden test cases