title: converting numerical output labels to categorical vectors in keras
body: <p>I'm creating a Deep learning multi-classification model in Keras and I have converted my outputlabel training set y_train from numerical values ranging from 1 to 14 to output vectors looking like this <code>[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0] =&gt; representing the number 2</code> . This is the code I used in python (keras):</p>
  
  <pre><code>from keras.utils import to_categorical
  y_train = to_categorical(y_train)
  </code></pre>
  
  <p>However, because it converts these outputlabels into a vector of length 15 instead of 14 because it adds zero as a potential output as well. My original numpy array y_train looked like this: <code>[1,8,9,7,2,2,8...]</code> and it should be converted to a vector of length 14 instead of 15 to avoid extra loss when training the model. Is there a simpel way to avoid using zero as a potential output class? </p>
  
  <p>(<code>num_classes = 14</code>  as a parameter of to_categorical gives an error message)</p>