Class label prediction in keras sequential model showing different results in confusion matrix
Model.predict_classes gives you the most likely class only (highest probability value), therefore it is of dimension (samples,), for every input in sample there is one output - the class.
To be more precise  Model.predict_classes calls argmax on the output of predict. See the code (of predict_classes below)
def predict_classes(self, X, batch_size=128, verbose=1):
  proba = self.predict(X, batch_size=batch_size, verbose=verbose)
        if self.class_mode == 'categorical':
            return proba.argmax(axis=-1)
        else:
            return (proba &gt; 0.5).astype('int32')

As the warning suggest, Please use instead:

np.argmax(model.predict(x), axis=-1),   if your model does multi-class classification   (e.g. if it uses a softmax last-layer activation).
(model.predict(x) &gt; 0.5).astype(&quot;int32&quot;),   if your model does binary classification   (e.g. if it uses a sigmoid last-layer activation).