facebook / facebook/prophet

Unable to run cross-validation in parallel mode "processes"

Open
#1,884 11 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
20.4k
Forks
4.6k
Avg merge
19h 52m
Merged PRs (30d)
1

Description

Hello, I'm using Prophet v1.0 with Anaconda3 2020.11 on Windows 10 64-bit. I'm trying to run cross-validation in parallel mode "processes" using the example provided in the documentation, but I always get this error message (the
[error.log](https://github.com/facebook/prophet/files/6386380/error.log) is very long so I attached it instead of pasting it here). The code I used:

```
import pandas as pd
import itertools
import numpy as np
from prophet import Prophet
from prophet.diagnostics import cross_validation
from prophet.diagnostics import performance_metrics

df = pd.read_csv("example_wp_log_peyton_manning.csv")

param_grid = {
"changepoint_prior_scale": [0.001, 0.01, 0.1, 0.5],
"seasonality_prior_scale": [0.01, 0.1, 1.0, 10.0],
}

# Generate all combinations of parameters
all_params = [dict(zip(param_grid.keys(), v)) for v in itertools.product(*param_grid.values())]
rmses = [] # Store the RMSEs for each params here

# Use cross validation to evaluate all parameters
for params in all_params:
m = Prophet(**params).fit(df) # Fit model with given params
df_cv = cross_validation(m, horizon="30 days", parallel="processes")
df_p = performance_metrics(df_cv, rolling_window=1)
rmses.append(df_p["rmse"].values[0])

# Find the best parameters
tuning_results = pd.DataFrame(all_params)
tuning_results["rmse"] = rmses
print(tuning_results)
```

If I run the code on Google Colab then everything is fine.

So can anyone help please? Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.