DEV Community

Cover image for Which classification have I used? As I know it should be KNN, but stuff wasn’t so easy.
Nicholas
Nicholas

Posted on

Which classification have I used? As I know it should be KNN, but stuff wasn’t so easy.

Hey guys ;)

This time I also don’t have much to say. But let’s try to explore some interesting things that happened this week.
Hello gif


Back to Uni

So, the most important reason why I have less time to work is University. But I must confess that I heard something that gave me more power to continue my journey. So, this week I worked on Music Classification only yesterday. On Monday and Tuesday I was just bored or something like that and didn't write any code. Then one lecture in uni gave me motivation and understanding that there are still so many things in the world that I don’t know yet. Maybe it’s the reason why I’m moving forward.
Deep thoughts


Music Classifier

Now I could say that the project is almost done. Yep it’s kinda strange, but learning models is the easiest part. So first I trained the KNN model, when I got 68% test accuracy I decided to change model. The first option was Random Forest, it gave me 78% accuracy. +10%, pretty impressive, but I still wanted more. So then I chose the XGBoost model. And finally I got 85% accuracy. Yep maybe it’s not perfect, maybe it would be great to gain 90% accuracy, but for now I think the model is pretty accurate. Here I’ll add some images (Confusion matrix and Top-15 important features).

Confusion matrix

Feature importance

So what do I need to do? Today I wanna finish the main part of the project. Write predict.py which will load trained models, extract all features, normalize features, and predict genres. And next week I need to write README and add some conclusions into notebook. Maybe compare KNN, Random Forest and XGBoost. I don't know yet what I’ll write there.


May I know your favorite songs?

I just wanna test my classifier later, so it’d be great to check it on your favorite songs. Yep, there will be one problem, my classifier only knows 10 genres, all of them you could see on the Confusion Matrix plot.
Curious me


So it’s all for today, see you later guys 😘

Top comments (1)

Collapse
 
technogamerz profile image
𝐓𝐡𝐞 𝐋𝐚𝐳𝐲 𝐆𝐢𝐫𝐥

Wow