Daily Dose of Data Science

Share this post

Enrich Your Confusion Matrix With A Sankey Diagram

www.blog.dailydoseofds.com

Enrich Your Confusion Matrix With A Sankey Diagram

An unexplored direction of visualising a confusion matrix.

Avi Chawla
May 6, 2023
14
Share

A confusion matrix is mostly interpreted as is, i.e., raw numbers. Sometimes though, it is also visualized by plotting it.

Traditional ways of previewing confusion matrix

Yet, both these ways are not interactive and truly elegant.

Plotting a confusion matrix as a Sankey diagram is an option worth exploring here.

If you wish to read more about Sankey Diagrams, read my previous post here: Analyse Flow Data With Sankey Diagrams.

As demonstrated below, one can interactively interpret the number of instances belonging to each class and how they were classified.

Confusion matrix as Sankey Diagram

What's more, hovering over the links gives more info about those instances, which can offer better interpretability.

What do you think? Is this a better approach than the traditional ones? Let me know :)

Find the code for creating the above Confusion Matrix Sankey diagram here: Notebook.

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.

👉 Read what others are saying about this post on LinkedIn and Twitter.

👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells me that you appreciate reading these daily insights. The button is located towards the bottom of this email.

👉 If you love reading this newsletter, feel free to share it with friends!

Share Daily Dose of Data Science


Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn and Twitter.

14
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing