Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to silent an output from Prophet?

I`m using Prophet (Time series library by Facebook) and it makes a lot of output. Something like this: Prophet output

I`m already silent some output like this:

@contextmanager
def suppress_stdout():
    with open(os.devnull, "w") as devnull:
        old_stdout = sys.stdout
        sys.stdout = devnull
        try:  
            yield
        finally:
            sys.stdout = old_stdout

But it doesn't silent all types of output, how I can silent all types?

like image 483
josqa Avatar asked Nov 07 '25 11:11

josqa


1 Answers

The problem here is the Prophet several loggers, which you can silent with:

import logging
logging.getLogger("prophet").setLevel(logging.ERROR)
logging.getLogger("cmdstanpy").setLevel(logging.ERROR)
like image 69
Pedro Muñoz Avatar answered Nov 10 '25 00:11

Pedro Muñoz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!