title: Should the data in batch be balanced?
body: <p>I'm training a deep learning model to predict three emotion(joy, sadness, anger) by feeding content of tweet.</p>
  
  <p>I encounter a problem is that my model can learning well on sadness, joy but very bad on joy.</p>
  
  <p><a href="https://i.stack.imgur.com/1lpHI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1lpHI.png" alt="Confusion matrix in three emotion"></a></p>
  
  <p>I think the reason why is that my train dataset is unbalanced. </p>
  
  <p>Data size in joy: 196952, sadness: 29407, anger: 42420</p>
  
  <p>So when training a model, batch size contain too many joy dataset which make model only guess the answer is joy rather than others.</p>
  
  <p>I want to fix this issue by balanced the data in each batch.
  That say batch size is 128, we randomly chose same amount of three emotion data. Prevent model to be dominant by data of joy.</p>
  
  <blockquote>
    <p>Question is: Should the data in batch be balanced?</p>
  </blockquote>
  
  <p>Other question is that, I randomly chose dataset, is this violate the definition of epoch. </p>
  
  <p>Because epoch mean that reading all train dataset. When randomly chose, maybe some dataset will not be chose in some epoch. Or just train more epoch will fix this issue?</p>
  
  <p>If anything I think is wrong, welcome to point out. Thanks!</p>