Not a cat?

NB: Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera

Why isn’t it a cat!? Is it something wrong in the rest of the code? I’ve passed all tests before running this (last) cell then ran every cell. Thanks in advance

As long as the training images cover the distribution of your test image, a well trained classifier can be expected to perform proper classification. You’ll learn techniques to build better image classifcation models all the way upto course 4 of this specialization.

I encourage you to visit this post once you reach end of course 4 and share your thoughts.

1 Like

For now, the most likely reason is that your cat image doesn’t closely enough resemble the cat images in the training set.

This classifier isn’t very sophisticated, so it assumes all of the images have been preprocessed to remove some of the variation.

Perhaps the scaling is different, or the centering, or the rotation of the image, or the amount of background color around the borders.

These issues are discussed in Section 6 of the notebook.

You might be able to look at some of the cat images and compare them with yours, and see if you can observe a difference.


Try finding a picture of your cat with a contrasting background. The logistic regression model test accuracy was only about 70% I recall. Also, you will revisit this in a later course with a more accurate model.

I had to search around a bit before finding a picture of my cat that worked. Good luck!

One of the challenges with this classic Machine Learning example is that the set of things which are “not a cat” is nearly infinite. So it’s difficult to have a comprehensive and reasonably-sized set of labeled “False” examples for training.