mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-17 08:40:56 +00:00
Add progress bar to cross_validation (#1338)
* tqdm * Added progress bar to the crossvalidation In order to improve the user experiance a progress bar is added to the crossvalidation loop. * Update requirements.txt * Update python/fbprophet/diagnostics.py * updated further * Update requirements.txt
This commit is contained in:
parent
952b544928
commit
d8dd2f53b7
2 changed files with 4 additions and 2 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from tqdm.autonotebook import tqdm
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
|
|
@ -54,7 +55,7 @@ def generate_cutoffs(df, horizon, initial, period):
|
||||||
logger.info('Making {} forecasts with cutoffs between {} and {}'.format(
|
logger.info('Making {} forecasts with cutoffs between {} and {}'.format(
|
||||||
len(result), result[-1], result[0]
|
len(result), result[-1], result[0]
|
||||||
))
|
))
|
||||||
return reversed(result)
|
return list(reversed(result))
|
||||||
|
|
||||||
|
|
||||||
def cross_validation(model, horizon, period=None, initial=None):
|
def cross_validation(model, horizon, period=None, initial=None):
|
||||||
|
|
@ -107,7 +108,7 @@ def cross_validation(model, horizon, period=None, initial=None):
|
||||||
|
|
||||||
cutoffs = generate_cutoffs(df, horizon, initial, period)
|
cutoffs = generate_cutoffs(df, horizon, initial, period)
|
||||||
predicts = []
|
predicts = []
|
||||||
for cutoff in cutoffs:
|
for cutoff in tqdm(cutoffs):
|
||||||
# Generate new object with copying fitting options
|
# Generate new object with copying fitting options
|
||||||
m = prophet_copy(model, cutoff)
|
m = prophet_copy(model, cutoff)
|
||||||
# Train model
|
# Train model
|
||||||
|
|
|
||||||
|
|
@ -9,3 +9,4 @@ convertdate>=2.1.2
|
||||||
holidays>=0.9.5
|
holidays>=0.9.5
|
||||||
setuptools-git>=1.2
|
setuptools-git>=1.2
|
||||||
python-dateutil>=2.8.0
|
python-dateutil>=2.8.0
|
||||||
|
tqdm>=4.42.1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue