machine learning - Keras: model.evaluate vs model.predict accuracy difference in multi-class NLP task -
i training simple model in keras nlp task following code. variable names self explanatory train, test , validation set. dataset has 19 classes final layer of network has 19 outputs. labels one-hot encoded. nb_classes = 19 model1 = sequential() model1.add(embedding(nb_words, embedding_dim, weights=[embedding_matrix], input_length=max_sequence_length, trainable=false)) model1.add(lstm(num_lstm, dropout=rate_drop_lstm, recurrent_dropout=rate_drop_lstm)) model1.add(dropout(rate_drop_dense)) model1.add(batchnormalization()) model1.add(dense(num_dense, activation=act)) model1.add(dropout(rate_drop_dense)) model1.add(batchnormalization()) model1.add(dense(nb_classes, activation = 'sigmoid')) model1.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) #one hot encode labels ytrain_enc = np_utils.to_categorical(train_labels) yval_enc = np_utils.to...