The world’s leading publication for data science, AI, and ML professionals.

How a data scientist…. decorates his newborn’s nursery?

A data-driven approach

Almost three years ago, my wife asked me to decorate a wall of my baby’s bedroom. So after searching a bunch of sites, we selected a vinyl piece composed of 117 "unperfect" circles of 4 colors.


Problem

Immediately, my head thought on the following question:

How to distribute them on a wall of 290cmx210cm? That’s easy…. Using R 😎


Getting Data

Extracting the right colors

Beforehand, I needed to get the HEX codes from the image.

How?

My first attempt was to use this website for that:

  • A8C6C4

  • 32312F

  • BDBFBE

  • D6C245

However, I was not happy with that solution. So I tried to automatically grab the colors from the image. 🚀

Firstly, I plotted the original picture.

Then, I cropped the image keeping only the top left corner in order to extract the hex codes of the circles in that picture.

Now, it was time to pick the HEX codes.


Preparing the dataset

With the selection finished, I was ready to project the circles on the wall, and a couple of minutes later…voilá. For that, I decided to use a uniform distribution.

Finally, it was time for the "real" work.👌

I know, I know....but I don't remember the seed used at the time.
I know, I know….but I don’t remember the seed used at the time.

Related Articles