#NoPayJan Offer - Access all CloudxLab Courses for free between 1st to 31st JanEnroll Now >>
Now that we have built the model, let us visualize how the model loss varies with respect to the epoch for the train data and validation data using matplotlib.
Firstly, let us have a look at the
history, where all the history about various parameters like loss, mean_squared_error, and validation mean_squared_error are stored when the model was fit on train data and validated on validation data.
Since we aim to plot the training loss an validation loss behavior with respect to the number of epochs, let us use those corresponding values from
loss represents the training loss and
val_loss indicates the validation loss.
Let us plot the training loss and validation loss. We shall also set the title, ylabel, xlabel, and legend for the plot and finally show it.
plt.plot(history.history['loss']) # plotting train loss plt.plot(<< your code comes here >>) # plotting validation loss plt.title('model loss') plt.ylabel('loss') plt.xlabel('epoch') plt.legend(['train', 'val'], loc='upper left') plt.show()
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here