Skip to content

Disable logging output in Jupyter notebooks. #2440

@ekamperi

Description

@ekamperi

Is your feature request related to a problem? Please describe.
While loading a pre-trained model & using it to generate predictions inside a Jupyter notebook, I get tons of logging messages, like:

INFO:logs:Initializing load_model()
INFO:logs:load_model(model_name=../scripts/saved_tuned_bm_00007, platform=None, authentication=None, verbose=True)
INFO:logs:Initializing predict_model()
INFO:logs:predict_model(estimator=Pipeline(steps=[('dtypes',
                 DataTypes_Auto_infer(display_types=False,
                                      ml_usecase='classification',
                                      target='label')),
[...]

Describe the solution you'd like
I'm not sure if PyCaret uses the root logger or a custom logger. If the former, then perhaps do the latter?

Describe alternatives you've considered
I tried many workarounds from StackOverflow on how to disable logging from imported modules, but none really worked.

Additional context
This is a screenshot from my notebook, where I get flooded by the logging messages:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions