I have a numeric dataset (not images) for apply deep learning classification. Dataset has 3 class but these are imbalanced sizes. For example class 1:200 , class 2:3200 , class 3:190 labels. I'm trying to train it in Keras or Tensorflow for classification. At the result; All prediction are collected in Class 2:
So i searched the problem in internet and i found that i must define an weighted loos function according to class sizes.
So i need a weighted loos function for my classification model can work properly. Nearly 5-10 lines codes. DO NOT COPY PAST FROM INTERNET.
Who can write it?