I followed the steps EXACTLY in the Hands on Machine Learning with Scikit Learn and TensorFlow ch. 3. But the confusion matrix for the multinomial classifier is very very bad. Even though the book expects the matrix score to be very good.

The matrix looks like this:
Confusion Matrix Plot

But the matrix should ACTUALLY look like this:

Actual Confusion Matrix Plot

Here is the link to the notebook: https://colab.research.google.com/drive/1x1vhgajdDYovFop59MoT5asQ9qyyP1ka

My question is, what mistake did I make in my steps? And should I adapt my program to future updates in scikit-learn, numpy, and pandas? (The book is stated as outdated in some parts)


closed as unclear what you're asking by timleathart, Siong Thye Goh, Djib2011, Stephen Rauch, Sean Owen Oct 7 '18 at 2:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.