It makes sense to start New Year on a lighter note. In this post, I will talk about a fun way to visualize multivariate data using a statistical device called Chernoff’s faces. The goal of Chernoff faces is to show a bunch of variables at once via facial features like lips, eyes, and nose size. Most of the time there are better solutions, but the faces can be interesting to work with.
In this post, we will analyse cricket data and we will try to compare 5 Indian batsmen: Sachin, Gambhir, Sehwag, Dhoni and Yuvraj Singh. A natural question that one might ask is how do we compare these 5 players? One can look at several metrics like strike rate, batting average etc and form an opinion. But looking at these metrics in a table might not be very soothing to eyes! One can create Chernoff faces and compare a lot of metrics across these players.
In this particular post, these players were compared on the following metrics:
1. Batting average
2. Strike rate
3. Number of fours per match
4. Number of sixers per match
5. Ratio of Innings to total matches played
To create Chernoff faces these metrics were mapped to certain facial features as given in the table below:
The data was collected from crickinfo.comย ย Following R code was used to create the graphic:
setwd(โF:\\Work\\Jigsaw Academy\\Blogs\\January 16โ)
data<-read.csv(โcrick.csvโ)
names(data)[1]<-โPlayerโ
names(data)[5]<-โ4perMatchโ
names(data)[6]<-โ6perMatchโ
library(aplpack)
dat<-data.frame(data[3],data[2],A=c(rep(3,5)),B=c(rep(3,5)),C=c(rep(3,5)),data[4],D=c(rep(3,5)),data[5],data[6],E=c(rep(3,5)),G=c(rep(3,5)),H=c(rep(3,5)),I=c(rep(3,5)),J=c(rep(3,5)),K=c(rep(3,5)),L=c(rep(3,5)))
faces(dat,labels=data$Player)
Here is the result:
As can be seen,ย the happiest face seems to be of Sehwag, no surprise there since he has the highest strike rate, a variable mapped to curve of theย smile. ย Also,ย notice Dhoni has a very long face, this is again due to the fact because the batting average is mapped to the height of face and Dhoni has a very good batting average.
Another thing to notice is the width of eyes for both Dhoni and Yuvraj, its very small, testament to the fact that both these players, although very good stroke makers, made a lot of runs by running between the wickets.
Hope you enjoyed this post. Indeed analytics can be fun!
If you are interested in making a career in the Data Science domain, our 11-month in-personย Postgraduate Certificate Diploma in Data Scienceย course can help you immensely in becoming a successful Data Science professional.ย
Fill in the details to know more
From The Eyes Of Emerging Technologies: IPL Through The Ages
April 29, 2023
Data Visualization Best Practices
March 23, 2023
What Are Distribution Plots in Python?
March 20, 2023
What Are DDL Commands in SQL?
March 10, 2023
Best TCS Data Analyst Interview Questions and Answers for 2023
March 7, 2023
Best Data Science Companies for Data Scientists !
February 26, 2023
Add your details:
By proceeding, you agree to our privacy policy and also agree to receive information from UNext through WhatsApp & other means of communication.
Upgrade your inbox with our curated newletters once every month. We appreciate your support and will make sure to keep your subscription worthwhile