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.
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…