How to Evaluate a Data Visualization
By: Benjamin Obi Tayo Ph.D.
Tags: Python, Data Science, Matplotlib, Data Visualization, Descriptive Analytics

Image by Benjamin O. Tayo

How to Evaluate a Data Visualization

A good data visualization should have all essential components in place

I. Introduction

Data visualization is one of the most important branches in data science. It is one of the main tools use to analyze and study relationships between different variables. Data visualization can be used for descriptive analytics. Data visualization is also used in machine learning during data preprocessing and analysis; feature selection; model building; model testing; and model evaluation.

In machine learning (predictive analytics), there are several metrics that can be used for model evaluation. For example, supervised learning (continuous target) model can be evaluated using metrics such as the R2 score, mean square error (MSE), or mean absolute error (MAE). Furthermore, a supervised learning (discrete target) model, also referred to as a classification model can be evaluated using metrics such as accuracy, precision, recall, f1 score, the area under ROC curve (AUC), etc.

Unlike machine learning models that can be evaluated by using a single performance metric, a data visualization cannot be evaluated by looking at just a single metric. Instead, a good data visualization can be evaluated based on the characteristics or components of the data visualization.

In this article, we discuss the essential components of good data visualization. In Section II, we present the various components of a good data visualization. In Section III, we examine some examples of good data visualizations. A brief summary concludes the article.

II. Components of a Good Data Visualization

A good data visualization is made up of several components that have to be pieced up together to produce an end product:

a) Data Component: An important first step in deciding how to visualize data is to know what type of data it is, e.g. categorical data, discrete data, continuous data, time series data, etc.

b) Geometric Component: Here is where you decide what kind of visualization is suitable for your data, e.g. scatter plot, line graphs, barplots, histograms, qqplots, smooth densities, boxplots, pairplots, heatmaps, etc.

c) Mapping Component: Here you need to decide what variable to use as your x-variable (independent or predictor variable) and what to use as your y-variable (dependent or target variable). This is important especially when your dataset is multi-dimensional with several features.

d) Scale Component: Here you decide what kind of scales to use, e.g. linear scale, log scale, etc.

e) Labels Component: This includes things like axes labels, titles, legends, font size to use, etc.

f) Ethical Component: Here, you want to make sure your visualization tells the true story. You need to be aware of your actions when cleaning, summarizing, manipulating, and producing a data visualization and ensure you aren’t using your visualization to mislead or manipulate your audience.

III. Examples of Good Data Visualizations

III.1 Barplots

III.1.1 Simple barplot

Figure 1. 2016 Market share of electric vehicles in selected countries. Image by Benjamin O. Tayo.

III.1.2 Barplot with a categorical variable

Figure 2. Quantity of advertising emails from Best Buy (BBY), Walgreens (WGN) and Walmart (WMT) in 2018. Image be Benjamin O. Tayo.

III.1.3 Barplot for comparison

Figure 3. 2020 Worldwide number of jobs by skill using LinkedIn search tool. Image by Benjamin O. Tayo.

III.2 Density plot

Figure 4. The probability distribution of the sample means of a uniform distribution using Monte-Carlo simulation. Image by Benjamin O. Tayo.

III.3 Scatter and line plots

III.3.1 Simple scatter plot

Figure 5. Ideal and fitted plots for the crew variable using multiple regression analysis. Image by Benjamin O. Tayo.

III.3.2 Scatter plot for comparison

Figure 6. Mean cross-validation scores for different regression models. Image by Benjamin O. Tayo.

III.3.3 Multiple scatter plots

Figure 7. Regression analysis using different values of the learning rate parameter. Image by Benjamin O. Tayo.

III.3.4 Scatter pairplot

Figure 8. Pairplot showing relationships between features in the dataset. Image source: Benjamin O. Tayo.

III.4 Heatmap plot

Figure 9. Covariance matrix plot showing correlation coefficients between features in the dataset. Image source: Benjamin O. Tayo.

III. 5 Weather data plot

Figure 10. Record temperatures for different months between 2005 to 2014. Image by Benjamin O. Tayo.

IV. Summary and Conclusion

In summary, we’ve discussed the essential components of good data visualization. Unlike in predictive modeling where a model can be evaluated using a single evaluation metric, in data visualization, evaluation is carried out by analyzing the visualization to make sure it contains all essential components of a good data visualization.

Additional Data Science/Machine Learning Resources

Data Science Minimum: 10 Essential Skills You Need to Know to Start Doing Data Science

Data Science Curriculum

Essential Maths Skills for Machine Learning

5 Best Degrees for Getting into Data Science

Theoretical Foundations of Data Science — Should I Care or Simply Focus on Hands-on Skills?

Machine Learning Project Planning

How to Organize Your Data Science Project

Productivity Tools for Large-scale Data Science Projects

A Data Science Portfolio is More Valuable than a Resume

For questions and inquiries, please email me: benjaminobi@gmail.com