1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Deep Learning in Python

Connected

Exercise

Evaluating model accuracy on validation dataset

Now it's your turn to monitor model accuracy with a validation data set. A model definition has been provided as model. Your job is to add the code to compile it and then fit it. You'll check the validation score in each epoch.

Instructions

100 XP
  • Compile your model using 'adam' as the optimizer and 'categorical_crossentropy' for the loss. To see what fraction of predictions are correct (the accuracy) in each epoch, specify the additional keyword argument metrics=['accuracy'] in model.compile().
  • Fit the model using the predictors and target. Create a validation split of 30% (or 0.3). This will be reported in each epoch.