From Kagglers: Best Project Setup for DS and ML

Original article was published by Bex Tuychiev on Artificial Intelligence on Medium

Visual display setup

This section is all about controlling the style of plots globally. First, we set the global style. My favorite and also, I think on Kaggle too, is fivethirtyeight of matplotlib. Other popular ones are seaborn‘s darkgrid or whitegrid and matplotlib‘s ggplot.

Then, for better clarity and to reduce the chart junk, we disable right and top spines of plots. Sometimes, it would be enough to just keep the bottom one. It depends on the plot, you can learn more about it in one of my articles on styling plots:

It is also a good idea to scale up the axis ticks. You can customize the parameters according to where you eventually display your plots.

For colors, I chose a nice custom palette. There are some very good ones in seaborn but it is just personal preference. Those color codes created this palette:


You can use sns.palplot() to create these nice looking palette plots (sns.color_palette() gives the current palette).

Lastly, I am using a little tweak to make the images render with more clarity. The difference is not noticeable in notebooks, but when you show the plots in other places like Medium, the distinction is very clear:

%config InlineBackend.figure_format = 'retina'