5

I am using fbprophet version 0.7.1 with pystan 2.19.1.1 on a quarterly time-series data, working on Jupyter Notebook.

Using extra regressors, here's my code.

    model = Prophet(daily_seasonality = False, weekly_seasonality = False)
    for regressor in extra_regressors:
        model.add_regressor(regressor)
    model.fit(df_train)

This results in very long logs/outputs such as:

Initial log joint probability = -50.7823
Iteration  1. Log joint probability =    36.5594. Improved by 87.3417.
Iteration  2. Log joint probability =    47.9345. Improved by 11.3751.
Iteration  3. Log joint probability =    61.4267. Improved by 13.4922.
Iteration  4. Log joint probability =    70.6681. Improved by 9.24134.
Iteration  5. Log joint probability =    73.2246. Improved by 2.55655.
Iteration  6. Log joint probability =     73.247. Improved by 0.0223382.
Iteration  7. Log joint probability =    73.2556. Improved by 0.00860014.
Iteration  8. Log joint probability =    73.2729. Improved by 0.0173013.
Iteration  9. Log joint probability =    73.3195. Improved by 0.0466379.
Iteration 10. Log joint probability =     73.506. Improved by 0.186518.
Iteration 11. Log joint probability =    73.5193. Improved by 0.0132468.
Iteration 12. Log joint probability =    73.7225. Improved by 0.203195.
Iteration 13. Log joint probability =    73.7487. Improved by 0.0262419.
Iteration 14. Log joint probability =    73.7833. Improved by 0.0345711.
Iteration 15. Log joint probability =    73.7998. Improved by 0.0165609.
Iteration 16. Log joint probability =    73.8655. Improved by 0.0656696.
Iteration 17. Log joint probability =    73.9223. Improved by 0.0567906.
Iteration 18. Log joint probability =    74.0284. Improved by 0.10612.
Iteration 19. Log joint probability =    74.0554. Improved by 0.0269437.
Iteration 20. Log joint probability =    74.0728. Improved by 0.0174187.

How do I disable these logs?

meliksahturker
  • 922
  • 2
  • 11
  • 20
  • 2
    Have you tried this approach to suppress the output that was suggested on the issue tracker? https://github.com/facebook/prophet/issues/223#issuecomment-326455744 – Nick ODell Nov 03 '21 at 22:30
  • 1
    As inconvenient it is, comparing to a simple argument of "verbose = 0", this works, thanks. – meliksahturker Nov 03 '21 at 22:37
  • Sorry about that. It's annoying, but it's the best solution I could find. I'm surprised there isn't a better way to do it. – Nick ODell Nov 03 '21 at 22:43
  • Answer presented here works: https://stackoverflow.com/questions/45551000/how-to-control-output-from-fbprophet – johnnyheineken Mar 21 '22 at 16:05

1 Answers1

0
import logging

logging.getLogger("prophet").setLevel(logging.WARNING)
logging.getLogger("cmdstanpy").disabled=True
Adriaan
  • 17,741
  • 7
  • 42
  • 75
Matze
  • 46
  • 3
  • 1
    Please read [answer] and [edit] your answer to contain an explanation as to why this code would actually solve the problem at hand. Always remember that you're not only solving the problem, but are also educating the OP and any future readers of this post. – Adriaan Mar 24 '23 at 13:55