diff --git a/docs/_docs/diagnostics.md b/docs/_docs/diagnostics.md
index c0c8eaa..9d2976d 100644
--- a/docs/_docs/diagnostics.md
+++ b/docs/_docs/diagnostics.md
@@ -40,16 +40,12 @@ head(df.cv)
# Python
from fbprophet.diagnostics import cross_validation
df_cv = cross_validation(m, initial='730 days', period='180 days', horizon = '365 days')
+```
+```python
+# Python
df_cv.head()
```
- HBox(children=(FloatProgress(value=0.0, max=11.0), HTML(value='')))
-
-
-
-
-
-
@@ -83,8 +79,8 @@ df_cv.head()
0 |
2010-02-16 |
8.956828 |
- 8.479812 |
- 9.450908 |
+ 8.460272 |
+ 9.476844 |
8.242493 |
2010-02-15 |
@@ -92,8 +88,8 @@ df_cv.head()
1 |
2010-02-17 |
8.723230 |
- 8.213162 |
- 9.217637 |
+ 8.208639 |
+ 9.222179 |
8.008033 |
2010-02-15 |
@@ -101,8 +97,8 @@ df_cv.head()
2 |
2010-02-18 |
8.607021 |
- 8.119864 |
- 9.066214 |
+ 8.106506 |
+ 9.104792 |
8.045268 |
2010-02-15 |
@@ -110,8 +106,8 @@ df_cv.head()
3 |
2010-02-19 |
8.528870 |
- 8.088676 |
- 9.024842 |
+ 8.061701 |
+ 9.024450 |
7.928766 |
2010-02-15 |
@@ -119,8 +115,8 @@ df_cv.head()
4 |
2010-02-20 |
8.270872 |
- 7.740251 |
- 8.760655 |
+ 7.773299 |
+ 8.745526 |
7.745003 |
2010-02-15 |
@@ -147,13 +143,6 @@ df.cv2 <- cross_validation(m, cutoffs = cutoffs, horizon = 365, units = 'days')
cutoffs = pd.to_datetime(['2013-02-15', '2013-08-15', '2014-02-15'])
df_cv2 = cross_validation(m, cutoffs=cutoffs, horizon='365 days')
```
-
- HBox(children=(FloatProgress(value=0.0, max=3.0), HTML(value='')))
-
-
-
-
-
The `performance_metrics` utility can be used to compute some useful statistics of the prediction performance (`yhat`, `yhat_lower`, and `yhat_upper` compared to `y`), as a function of the distance from the cutoff (how far into the future the prediction was). The statistics computed are mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), mean absolute percent error (MAPE), median absolute percent error (MDAPE) and coverage of the `yhat_lower` and `yhat_upper` estimates. These are computed on a rolling window of the predictions in `df_cv` after sorting by horizon (`ds` minus `cutoff`). By default 10% of the predictions will be included in each window, but this can be changed with the `rolling_window` argument.
@@ -268,7 +257,7 @@ from fbprophet.plot import plot_cross_validation_metric
fig = plot_cross_validation_metric(df_cv, metric='mape')
```
-
+
The size of the rolling window in the figure can be changed with the optional argument `rolling_window`, which specifies the proportion of forecasts to use in each rolling window. The default is 0.1, corresponding to 10% of rows from `df_cv` included in each window; increasing this will lead to a smoother average curve in the figure. The `initial` period should be long enough to capture all of the components of the model, in particular seasonalities and extra regressors: at least a year for yearly seasonality, at least a week for weekly seasonality, etc.
diff --git a/docs/static/diagnostics_files/diagnostics_14_0.png b/docs/static/diagnostics_files/diagnostics_14_0.png
deleted file mode 100644
index e974428..0000000
Binary files a/docs/static/diagnostics_files/diagnostics_14_0.png and /dev/null differ
diff --git a/docs/static/diagnostics_files/diagnostics_15_0.png b/docs/static/diagnostics_files/diagnostics_15_0.png
index 0810ddf..e974428 100644
Binary files a/docs/static/diagnostics_files/diagnostics_15_0.png and b/docs/static/diagnostics_files/diagnostics_15_0.png differ
diff --git a/docs/static/diagnostics_files/diagnostics_16_0.png b/docs/static/diagnostics_files/diagnostics_16_0.png
new file mode 100644
index 0000000..0810ddf
Binary files /dev/null and b/docs/static/diagnostics_files/diagnostics_16_0.png differ
diff --git a/notebooks/diagnostics.ipynb b/notebooks/diagnostics.ipynb
index 2f31a91..e9764fb 100644
--- a/notebooks/diagnostics.ipynb
+++ b/notebooks/diagnostics.ipynb
@@ -10,7 +10,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "622a0104e841488fae81864678a008b3",
+ "model_id": "0700e1522a544128889a6f25fa181c2b",
"version_major": 2,
"version_minor": 0
},
@@ -175,13 +175,15 @@
},
{
"cell_type": "code",
- "execution_count": 5,
- "metadata": {},
+ "execution_count": 3,
+ "metadata": {
+ "output_hidden": true
+ },
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "da408f9d6cf940f3ab28dcc7114e629c",
+ "model_id": "d198a659eea54089876a9d87e61a09ff",
"version_major": 2,
"version_minor": 0
},
@@ -198,7 +200,18 @@
"text": [
"\n"
]
- },
+ }
+ ],
+ "source": [
+ "from fbprophet.diagnostics import cross_validation\n",
+ "df_cv = cross_validation(m, initial='730 days', period='180 days', horizon = '365 days')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
{
"data": {
"text/html": [
@@ -233,8 +246,8 @@
" 0 | \n",
" 2010-02-16 | \n",
" 8.956828 | \n",
- " 8.479812 | \n",
- " 9.450908 | \n",
+ " 8.460272 | \n",
+ " 9.476844 | \n",
" 8.242493 | \n",
" 2010-02-15 | \n",
" \n",
@@ -242,8 +255,8 @@
" 1 | \n",
" 2010-02-17 | \n",
" 8.723230 | \n",
- " 8.213162 | \n",
- " 9.217637 | \n",
+ " 8.208639 | \n",
+ " 9.222179 | \n",
" 8.008033 | \n",
" 2010-02-15 | \n",
" \n",
@@ -251,8 +264,8 @@
" 2 | \n",
" 2010-02-18 | \n",
" 8.607021 | \n",
- " 8.119864 | \n",
- " 9.066214 | \n",
+ " 8.106506 | \n",
+ " 9.104792 | \n",
" 8.045268 | \n",
" 2010-02-15 | \n",
" \n",
@@ -260,8 +273,8 @@
" 3 | \n",
" 2010-02-19 | \n",
" 8.528870 | \n",
- " 8.088676 | \n",
- " 9.024842 | \n",
+ " 8.061701 | \n",
+ " 9.024450 | \n",
" 7.928766 | \n",
" 2010-02-15 | \n",
" \n",
@@ -269,8 +282,8 @@
" 4 | \n",
" 2010-02-20 | \n",
" 8.270872 | \n",
- " 7.740251 | \n",
- " 8.760655 | \n",
+ " 7.773299 | \n",
+ " 8.745526 | \n",
" 7.745003 | \n",
" 2010-02-15 | \n",
" \n",
@@ -280,21 +293,19 @@
],
"text/plain": [
" ds yhat yhat_lower yhat_upper y cutoff\n",
- "0 2010-02-16 8.956828 8.479812 9.450908 8.242493 2010-02-15\n",
- "1 2010-02-17 8.723230 8.213162 9.217637 8.008033 2010-02-15\n",
- "2 2010-02-18 8.607021 8.119864 9.066214 8.045268 2010-02-15\n",
- "3 2010-02-19 8.528870 8.088676 9.024842 7.928766 2010-02-15\n",
- "4 2010-02-20 8.270872 7.740251 8.760655 7.745003 2010-02-15"
+ "0 2010-02-16 8.956828 8.460272 9.476844 8.242493 2010-02-15\n",
+ "1 2010-02-17 8.723230 8.208639 9.222179 8.008033 2010-02-15\n",
+ "2 2010-02-18 8.607021 8.106506 9.104792 8.045268 2010-02-15\n",
+ "3 2010-02-19 8.528870 8.061701 9.024450 7.928766 2010-02-15\n",
+ "4 2010-02-20 8.270872 7.773299 8.745526 7.745003 2010-02-15"
]
},
- "execution_count": 5,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "from fbprophet.diagnostics import cross_validation\n",
- "df_cv = cross_validation(m, initial='730 days', period='180 days', horizon = '365 days')\n",
"df_cv.head()"
]
},
@@ -321,7 +332,9 @@
{
"cell_type": "code",
"execution_count": 7,
- "metadata": {},
+ "metadata": {
+ "output_hidden": true
+ },
"outputs": [
{
"data": {
@@ -703,6 +716,7 @@
}
],
"metadata": {
+ "celltoolbar": "Edit Metadata",
"kernelspec": {
"display_name": "Python 3",
"language": "python",