After fitting the model, we will evaluate its performance in terms of loss and accuracy. We will also create a confusion matrix to assess classification performance across all 10 types of fashion items. We will perform a model evaluation and prediction for both train and test data. We will also obtain images of fashion items that do not belong to the MNIST fashion data and explore how well the performance of the model can be generalized to new images.
Model evaluation and prediction
Training data
Loss and accuracy based on training data are obtained as 0.115 and 0.960, respectively, as shown in the following code:
# Model evaluation
model %>% evaluate(trainx, trainy)
$loss 0.1151372
$acc 0.9603167
Next, we create a confusion...