title: Keras - How to use argmax for predictions
body: <p>I have 3 categories of classes <code>Tree, Stump, Ground</code>. I've made a list for these categories:</p>
  
  <pre><code>CATEGORIES = ["Tree", "Stump", "Ground"]
  </code></pre>
  
  <p>When i print my prediction, it gives me the output of</p>
  
  <pre><code>[[0. 1. 0.]]
  </code></pre>
  
  <p>I've read up about numpy's Argmax but I'm not entirely sure how to use it in this case.</p>
  
  <p>I've tried using </p>
  
  <pre><code>print(np.argmax(prediction))
  </code></pre>
  
  <p>But that gives me the output of <code>1</code>. That's great but I would like to find out what's the index of <code>1</code> and then print out the Category instead of the highest value.</p>
  
  <pre><code>import cv2
  import tensorflow as tf
  import numpy as np
  
  CATEGORIES = ["Tree", "Stump", "Ground"]
  
  
  def prepare(filepath):
      IMG_SIZE = 150 # This value must be the same as the value in Part1
      img_array = cv2.imread(filepath, cv2.IMREAD_GRAYSCALE)
      new_array = cv2.resize(img_array, (IMG_SIZE, IMG_SIZE))
      return new_array.reshape(-1, IMG_SIZE, IMG_SIZE, 1)
  
  # Able to load a .model, .h3, .chibai and even .dog
  model = tf.keras.models.load_model("models/test.model")
  
  prediction = model.predict([prepare('image.jpg')])
  print("Predictions:")
  print(prediction)
  print(np.argmax(prediction))
  
  </code></pre>
  
  <p>I expect my prediction to show me:</p>
  
  <pre><code>Predictions:
  [[0. 1. 0.]]
  Stump
  </code></pre>
  
  <p>Thanks for reading :) I appreciate any help at all.</p>