In this section, we will evaluate the model based on both training and test data. We will also create a confusion matrix for both train and test data to gain further insights into the movie review sentiment classification performance of the model.
Evaluating model performance
Model evaluation with train data
We will first evaluate the model performance with train data using the following code:
# Evaluate
model %>% evaluate(train_x, train_y)
$loss
[1] 0.3749587
$acc
[1] 0.82752
As seen from the preceding output, for the training data, we obtain a loss value of 0.375 and an accuracy of about 0.828. This is a decent performance considering a relatively simple LSTM architecture. We next use this model to make predictions for...