12 Days of Data Analytics: Day 3 – Unlock The Power In Your Data

Let’s start today’s post in space. The image below shows an astronaut on the surface of the moon (this image, and many of the others in this post come from the very excellent book Digital Image Processing by Gonzalez & Woods). The image, however, has been corrupted with cosmic noise and so it is very hard to make much sense of it. Luckily noise removal is one of the core jobs in image processing and should help us to clean up this image.

Source: Digital Image Processing by Gonzalez & Woods

If we zoom right in on this image we can see that the basic data representation for a grey-scale image like this is a grid of pixels each containing a shade of grey.

Source: Digital Image Processing by Gonzalez & Woods

Using this simple representation we can perform a simple convolution operation on the image to attempt to remove the noise. This is a standard technique in image processing and the main tool in the image processing toolbox for working with pixel representations like this. Unfortunately, as shown below, although the image is cleaned up it is not quite as sharp as we might like.

Source: Digital Image Processing by Gonzalez & Woods

We could work more on trying out different types of convolution kernels and this would probably lead to some improvement, but we will hit a wall in terms of what can be achieved with this type of representation. Rather than trying to push against this wall, we can instead change the data representation. The fast Fourier transform is another standard tool in the digital image processing toolbox. This transforms the representation of an image from a set of pixel values into a set of frequencies, or converts the image into the frequency domain. Below we show our image of the astronaut on the surface of the moon represented in the frequency domain. The details of exactly what is going on here are not terribly important (although Chapter 4 of Digital Image Processing by Gonzalez & Woods goes into this in great detail and is fascinating stuff). What is important is that when we look at the frequency domain image below a set of bright points arranged in a ring around the image jump out. The noise that is corrupting this image is sinusoidal in nature (most likely cause by the camera being near a generator or other equipment like that) and so really pops out once the representation of the image is changed to the frequency domain.

Source: Digital Image Processing by Gonzalez & Woods

Even better removing the noise is now very easy. We can apply what is called a band pass filter which removes particular frequencies from the image – int his case the frequencies represented by the bright spots in the ring. After applying the band pass filter we get the lovely, sharp, clean image below.

Source: Digital Image Processing by Gonzalez & Woods

Now, that was a lot of image processing for a post about data analytics but a lesson can be taken directly over to analytics projects. Often times changing our data representation is the most powerful thing we can do to generate better insights from our data. Here is a really simple example from the world of sabremetrics. The small dataset below shows the number of passes made and the number of passes completed in a season by 30 American football quarterbacks. Also shown in the value that the press corps placed on each quarterback at the end of the season.

PlayerTeamPasses AttemptedPasses CompletedPlayer Value
D.CulpepperMIN548379110.9
D.McNabbPHI469300104.7
B.GrieseTAM336233102.5
M.BulgerSTL48532193.7
B.FavreGBP54034692.4
J.DelhommeCAR53331087.3
K.WarnerNYG27717486.5
M.HasselbeckSEA47427983.1
A.BrooksNOS54230979.5
T.RattaySFX32519878.1
M.VickATL32118178.1
J.HarringtonDET48927477.5
V.TestaverdeDAL49529776.4
P.RamseyWAS27216977.8
J.McCownARI40823374.1
P.ManningIND497336113.1
D.BreesSDC400262104.8
B.RoethlisbergerPIT29519698.1
T.GreenKAN55636995.2
T.BradyNEP47428892.6
C.PenningtonNYJ37024291.0
B.VolekTEN35721887.1
J.PlummerDEN52130384.5
D.CarrHOU46628583.5
B.LeftwichJAC44126782.2
C.PalmerCIN43226377.3
J.GarciaCLE25214476.7
D.BledsoeBUF45025676.6
K.CollinsOAK51328974.8
K.BollerBAL46425870.9

It would be useful to understand how the statistics we can measure about a player influence the value the press corps place on that player. the images below show scatter plots illustrating the relationships between player value and passes completed and player value and pass attempted. The correlation coefficients between each of these player statistics and player value are 0.15 and 0.453 respectively which suggest pretty weak associations.

A simple change to the data representation, however, can add significantly more value to this dataset. Simply dividing a player’s passes completed statistic by their passes attempted statistic yields the player’s percentage of passes completed.

PlayerTeamPasses AttemptedPasses CompletedPass Completion %Player Value
D.CulpepperMIN54837969110.9
D.McNabbPHI46930064104.7
B.GrieseTAM33623369102.5
M.BulgerSTL4853216693.7
B.FavreGBP5403466492.4
J.DelhommeCAR5333105887.3
K.WarnerNYG2771746386.5
M.HasselbeckSEA4742795983.1
A.BrooksNOS5423095779.5
T.RattaySFX3251986178.1
M.VickATL3211815678.1
J.HarringtonDET4892745677.5
V.TestaverdeDAL4952976076.4
P.RamseyWAS2721696277.8
J.McCownARI4082335774.1
P.ManningIND49733668113.1
D.BreesSDC40026266104.8
B.RoethlisbergerPIT2951966698.1
T.GreenKAN5563696695.2
T.BradyNEP4742886192.6
C.PenningtonNYJ3702426591.0
B.VolekTEN3572186187.1
J.PlummerDEN5213035884.5
D.CarrHOU4662856183.5
B.LeftwichJAC4412676182.2
C.PalmerCIN4322636177.3
J.GarciaCLE2521445776.7
D.BledsoeBUF4502565776.6
K.CollinsOAK5132895674.8
K.BollerBAL4642585670.9

Percentage of passes completed is a much more useful measure in trying to determine the player value. This is evident in the scatter plot below and the correlation coefficient of 0.87 between player value of percent passes completed.

This is a pretty simple example and it is unlikely that any American football teams will be beating down our door based on this insight. Determining good metrics in sports, however, is serious business. Moneyball is one of our favourite movies (and books) here at The Analytics Store and one of our favourite scenes is when Billy Bean repeatedly turns to Peter Brand in the scouting meeting for the refrain “because he gets on base“. The number of times a player got on base was the key metric for capturing the value of a player.

Although he probably never actually said it (see here), Albert Einstein is often attributed with the quote: “If I had an hour to solve a problem I’d spend 55 minutes thinking about the problem and 5 minutes thinking about solutions.” In data analytics we say:
“If I had an hour to analyse a dataset I’d spend 55 minutes working on the data representation and 5 minutes running the analysis.”

2020-05-18T08:32:45+00:00Analytics, Business, Industry|
Go to Top