Hi folks. I had a question about the lab “Logistic_Regression_with_a_Neural_Network_mindset”. In particular, running the cell labeled “# Example of a picture that was wrongly classified.”
With that header, I assumed it was expected itself to present such a case. Maybe we are supposed to go look for one? Because the default one, index 1, is once, twice, three times a cat:
- it looks like a cat to me
- it is labeled as a cat
- it is predicted as a cat
Example of a picture that was wrongly classified.
index = 1
plt.imshow(test_set_x[:, index].reshape((num_px, num_px, 3)))
print ("y = " + str(test_set_y[0,index]) + “, you predicted that it is a "” + classes[int(logistic_regression_model[‘Y_prediction_test’][0,index])].decode(“utf-8”) + “" picture.”)
y = 1, you predicted that it is a “cat” picture.
In other courses, there was code to scan for mismatches. I may put that in myself. But is this expected? Maybe it’s just luck that my model happened to categorize this one correctly? My percentages were normal.
My model in JSON:
cat_model.txt (658.1 KB)
I added this. First mismatching index was five, a butterfly:
indexes = [i for i in range(len(test_set_y[0])) if test_set_y[0,i] != int(logistic_regression_model[‘Y_prediction_test’][0,i])]
index = indexes[0]
