title: How to get predicted values in Keras?
body: <p>In Keras test sample evaluation is done like this</p>
  
  <pre><code>score = model.evaluate(testx, testy, verbose=1)
  </code></pre>
  
  <p>This does not return predicted values. There is a method <code>predict</code> which return predicted values  </p>
  
  <pre><code>model.predict(testx, verbose=1)
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>[ 
  [.57 .21 .21]
  [.19 .15 .64]
  [.23 .16 .60] 
  .....
  ]
  </code></pre>
  
  <p><code>testy</code> is one hot encode and its values are like this</p>
  
  <pre><code>[
  [1 0 0]
  [0 0 1]
  [0 0 1]
  ]
  </code></pre>
  
  <p>How can the predicted values like <code>testy</code> or how to convert the predicted values to one hot encoded?</p>
  
  <p><strong>note</strong>: my model looks like this</p>
  
  <pre><code># setup the model, add layers
  model = Sequential()
  model.add(Conv2D(32, kernel_size=(3,3), activation='relu', input_shape=input_shape))
  model.add(MaxPooling2D(pool_size=(2, 2)))
  model.add(Dropout(0.25))
  model.add(Flatten())
  model.add(Dense(64, activation='relu'))
  model.add(Dropout(0.5))
  model.add(Dense(classes, activation='softmax'))
  
  # compile model
  model.compile(loss=keras.losses.categorical_crossentropy, optimizer=keras.optimizers.Adadelta(), metrics=['accuracy'])
  
  # fit the model
  model.fit(trainx, trainy, batch_size=batch_size, epochs=iterations, verbose=1, validation_data=(testx, testy))
  </code></pre>