title: index 1 is out of bounds for axis 0 with size 1 in python
body: <p>I am trying to evaluate my train data set: </p>
  
  <h1>Evaluate training</h1>
  
  <pre><code>score = classifier.evaluate(X_test, y_test, verbose=1)
  print("\nTest Results for {} test entries \
  on which we did not trained the neural network.\n".format(len(X_test)))
  
  print("Keras evaluation result:", score[0])
  print("Percentage right: {}%.".format(score[1]*100))
  print("Error: {}%.\n".format((1-score[1])*100))
  
  def evaluate_model(classifier, X_test, y_test):
      confusion_matrix = np.array([
          [0, 0], 
          [0, 0]
      ])
      pred = classifier.predict(X_train)
      for i in range(len(pred)):
          prediction = pred[i]
          if prediction[0]&gt;prediction[1]:
              prediction = 1
          else:
              prediction = 0
  
          expected = y_train[i][0]
          confusion_matrix[prediction][expected] += 1
  
      return confusion_matrix
  
  confusion_matrix = evaluate_model(classifier, X_test, y_test)
  confusion_matrix_interpretation = np.array([
          ["true negative", "false negative"], 
          ["false positive", "true positive"]
      ])
  print("Confusion matrix:")
  print(confusion_matrix)
  print("Confusion matrix, percentage of data:")
  print(confusion_matrix*100/sum(confusion_matrix.flatten()))
  print("Confusion matrix interpretation:\n", confusion_matrix_interpretation)
  </code></pre>
  
  <p>problem: index 1 is out of bounds for axis 0 with size 1
  what could be the possible solution. thanks in advance</p>