1
$\begingroup$

I am building a 2D Convolutional Neural Network for MFCC features for audio classification.

The issue I am facing is that there are 2 classes and huge imbalance between them. One class has 17687 samples while other has 67737 samples. I have done one hot encoding so I have two CNN outputs as [1,0] and [0,1].

From my research it seems that adding class_weights in model.fit only seems to work for binary classification problems. Is there any way I can assign weights to one hot encoded results?

$\endgroup$

1 Answer 1

1
$\begingroup$

You might want to consider using metrics such as the f1-score in order to measure how well your model does.

Notice that if, in real life, the inbalance will be of a similar nature, then your model has to account for it anyway.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.