Sitemap
The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +772K followers.

Follow publication

Photo by Milkovi on Unsplash

Member-only story

Why You Should Use Logzero as a Logger in Your Data Science Projects

Logging is a sort of improvement for python print statements. Let’s see why, and how the great logzero package helps to make easy and nice logs.

5 min readMay 31, 2020

--

Printing or Logging?

Print is the first statement everyone learns when starting with Python. It is also one of the scarce statement which makes the difference between Python 2 and Python 3. Python-ers have a history of printing.

print(‘Hello World!’)

The print statement is very useful and allows you to track information while your code is running. But it has one huge drawback: when you close your python session or re-run a notebook cell, you lose all the printed information. Even the important ones. And this is even more true when it comes to Machine Learning, where you often need to run grid search or any iterative process:

  • Select parameters / print parameters / run experiment / print accuracy through epochs
  • Observe results / change an hyper-parameter / Re-run experiment / Loose the previous printed informations

To prevent these losses, you could use the logging module which is part of the python standard…

--

--

The Startup
The Startup

Published in The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +772K followers.

Thibaud Lamothe 🤠
Thibaud Lamothe 🤠

Written by Thibaud Lamothe 🤠

Head of Data @ Iroko, from Paris | Visit my website www.etomal.com | Unlock unlimited content medium.etomal.com/membership | 🤠

No responses yet