title: sample X examples from each class label
body: <p>l have a dataset (numpy vector) with <code>50 classes</code> and 9000 training examples. </p>
  
  <pre><code>x_train=(9000,2048)
  y_train=(9000,)  # Classes are strings 
  classes=list(set(y_train))
  </code></pre>
  
  <p>l would like to build a sub-dataset such that each class will have 5 examples</p>
  
  <p>which means l get <code>5*50=250</code> training examples. Hence my sub-dataset will take this form :</p>
  
  <pre><code>sub_train_data=(250,2048)
  sub_train_labels=(250,)
  </code></pre>
  
  <p>Remark : we take randomly 5 examples from each class (total number of classes = 50)</p>
  
  <p>Thank you</p>