2021年3月5日星期五

How to set class weights by dictionary for imbalanced classes in Keras or Tensorflow?

How may I create a dictionary in Keras or Tensorflow with the class_weights parameter?

I have a dataset with 12 classes. I split them with 70% of Train and 15% of test and validation. However, my training set classes are imbalanced. The classes contain the image data as below:

class 1 to 12: 217, 317, 235, 489, 177, 377, 534, 180, 425,192, 403, 324

Images respectively.

https://stackoverflow.com/questions/66501676/how-to-set-class-weights-by-dictionary-for-imbalanced-classes-in-keras-or-tensor March 06, 2021 at 10:02AM

没有评论:

发表评论