mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-11 17:48:42 +00:00
Don't use tqdm with multiprocessing starmap
This commit is contained in:
parent
39c619dbf7
commit
44ceaa8d8b
1 changed files with 5 additions and 5 deletions
|
|
@ -111,18 +111,18 @@ def cross_validation(model, horizon, period=None, initial=None, multiprocess=Fal
|
|||
if model.uncertainty_samples:
|
||||
predict_columns.extend(['yhat_lower', 'yhat_upper'])
|
||||
|
||||
predicts = []
|
||||
cutoffs = generate_cutoffs(df, horizon, initial, period)
|
||||
|
||||
if multiprocess is True:
|
||||
with Pool() as pool:
|
||||
logger.info('Running cross validation in multiprocessing mode')
|
||||
input_df = ((df, model, cutoff, horizon, predict_columns) for cutoff in tqdm(cutoffs))
|
||||
input_df = ((df, model, cutoff, horizon, predict_columns) for cutoff in cutoffs)
|
||||
predicts = pool.starmap(single_cutoff_forecast, input_df)
|
||||
else:
|
||||
if multiprocess is False:
|
||||
for cutoff in tqdm(cutoffs):
|
||||
predicts.append(single_cutoff_forecast(df, model, cutoff, horizon, predict_columns))
|
||||
predicts = [
|
||||
single_cutoff_forecast(df, model, cutoff, horizon, predict_columns)
|
||||
for cutoff in tqdm(cutoffs)
|
||||
]
|
||||
|
||||
# Combine all predicted pd.DataFrame into one pd.DataFrame
|
||||
return pd.concat(predicts, axis=0).reset_index(drop=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue