mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
Set verbosity for Printing Meta Information (#197)
* Set verbosity for Printing Meta Information (#188) * Fixed Indent and Removed Typos
This commit is contained in:
parent
1d5cb784c4
commit
283e9be5e0
1 changed files with 10 additions and 5 deletions
|
|
@ -12,6 +12,9 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
from matplotlib import pyplot as plt
|
from matplotlib import pyplot as plt
|
||||||
from matplotlib.dates import MonthLocator, num2date
|
from matplotlib.dates import MonthLocator, num2date
|
||||||
|
|
@ -27,11 +30,13 @@ from fbprophet.models import prophet_stan_models
|
||||||
try:
|
try:
|
||||||
import pystan
|
import pystan
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print('You cannot run prophet without pystan installed')
|
logger.error('You cannot run prophet without pystan installed')
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# fb-block 2
|
# fb-block 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Prophet(object):
|
class Prophet(object):
|
||||||
"""Prophet forecaster.
|
"""Prophet forecaster.
|
||||||
|
|
||||||
|
|
@ -377,8 +382,8 @@ class Prophet(object):
|
||||||
if self.yearly_seasonality == 'auto':
|
if self.yearly_seasonality == 'auto':
|
||||||
if last - first < pd.Timedelta(days=730):
|
if last - first < pd.Timedelta(days=730):
|
||||||
self.yearly_seasonality = False
|
self.yearly_seasonality = False
|
||||||
print('Disabling yearly seasonality. Run prophet with '
|
logger.info('Disabling yearly seasonality. Run prophet with '
|
||||||
'yearly_seasonality=True to override this.')
|
'yearly_seasonality=True to override this.')
|
||||||
else:
|
else:
|
||||||
self.yearly_seasonality = True
|
self.yearly_seasonality = True
|
||||||
if self.weekly_seasonality == 'auto':
|
if self.weekly_seasonality == 'auto':
|
||||||
|
|
@ -387,8 +392,8 @@ class Prophet(object):
|
||||||
if ((last - first < pd.Timedelta(weeks=2)) or
|
if ((last - first < pd.Timedelta(weeks=2)) or
|
||||||
(min_dt >= pd.Timedelta(weeks=1))):
|
(min_dt >= pd.Timedelta(weeks=1))):
|
||||||
self.weekly_seasonality = False
|
self.weekly_seasonality = False
|
||||||
print('Disabling weekly seasonality. Run prophet with '
|
logger.info('Disabling weekly seasonality. Run prophet with '
|
||||||
'weekly_seasonality=True to override this.')
|
'weekly_seasonality=True to override this.')
|
||||||
else:
|
else:
|
||||||
self.weekly_seasonality = True
|
self.weekly_seasonality = True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue