Login using Social Account
     Continue with GoogleLogin using your credentials
Let us just have a look at some of the correctly classified and misclassified samples by our model.
Note:
Write each of the 4 code blocks mentioned below in different code-cells of your jupyter notebook. This would help you understand and visualize better.
Plot the image of a correctly classified cat image using matplotlib.
num_px = train_set_x_orig.shape[1]
plt.imshow(test_set_x[:,1].reshape((num_px, num_px, 3)))
predicted_value = Y_prediction_test[0][1]
print("Predicted as:",classes[int(predicted_value)].decode('utf-8'))
predicted_value
Plot the image of a correctly classified non-cat image using matplotlib.
num_px = train_set_x_orig.shape[1]
plt.imshow(test_set_x[:,2].reshape((num_px, num_px, 3)))
predicted_value = Y_prediction_test[0][2]
print("Predicted as:",classes[int(predicted_value)].decode('utf-8'))
predicted_value
Plot the image of an incorrectly classified cat image using matplotlib.
num_px = train_set_x_orig.shape[1]
plt.imshow(test_set_x[:,3].reshape((num_px, num_px, 3)))
predicted_value = Y_prediction_test[0][3]
print("Predicted as:",classes[int(predicted_value)].decode('utf-8'))
predicted_value
Plot the image of an incorrectly classified non-cat image using matplotlib.
num_px = train_set_x_orig.shape[1]
plt.imshow(test_set_x[:,4].reshape((num_px, num_px, 3)))
predicted_value = Y_prediction_test[0][4]
print("Predicted as:",classes[int(predicted_value)].decode('utf-8'))
predicted_value
Taking you to the next topic in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...