Skip to content

Commit

Permalink
fix predict_insample docstrings (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoralez authored Nov 28, 2023
1 parent 92cd397 commit 9729006
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 139 deletions.
114 changes: 21 additions & 93 deletions nbs/src/core/models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" mean = fitted_arima(self.model_)\n",
" res = {'fitted': mean}\n",
Expand Down Expand Up @@ -1176,7 +1176,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -1682,7 +1682,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None: \n",
Expand Down Expand Up @@ -2123,7 +2123,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -2562,7 +2562,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" mean = fitted_arima(self.model_)\n",
" res = {'fitted': mean}\n",
Expand Down Expand Up @@ -3329,7 +3329,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
Expand Down Expand Up @@ -3649,7 +3649,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" return res\n",
Expand Down Expand Up @@ -3987,7 +3987,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" return res\n",
Expand Down Expand Up @@ -4362,7 +4362,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" return res\n",
Expand Down Expand Up @@ -5124,7 +5124,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -5456,7 +5456,7 @@
" Returns\n",
" -------\n",
" forecasts : dict\n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -5883,7 +5883,7 @@
" Returns\n",
" -------\n",
" forecasts : dict\n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -6248,7 +6248,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\" \n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -6629,7 +6629,7 @@
" Returns\n",
" -------\n",
" forecasts : dict\n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" raise NotImplementedError\n",
" \n",
Expand Down Expand Up @@ -6766,15 +6766,6 @@
"show_doc(WindowAverage.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(WindowAverage.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -6958,7 +6949,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" raise NotImplementedError\n",
"\n",
Expand Down Expand Up @@ -7100,15 +7091,6 @@
"show_doc(SeasonalWindowAverage.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(SeasonalWindowAverage.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -7287,7 +7269,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" raise NotImplementedError\n",
" \n",
Expand Down Expand Up @@ -7435,15 +7417,6 @@
"show_doc(ADIDA.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(ADIDA.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -7614,7 +7587,7 @@
" Returns\n",
" -------\n",
" forecasts : dict\n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" raise NotImplementedError\n",
" \n",
Expand Down Expand Up @@ -7751,15 +7724,6 @@
"show_doc(CrostonClassic.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(CrostonClassic.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -7929,7 +7893,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\" \n",
" raise NotImplementedError\n",
"\n",
Expand Down Expand Up @@ -8063,15 +8027,6 @@
"show_doc(CrostonOptimized.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(CrostonOptimized.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -8373,15 +8328,6 @@
"show_doc(CrostonSBA.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(CrostonSBA.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -8690,15 +8636,6 @@
"show_doc(IMAPA.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(IMAPA.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -9029,15 +8966,6 @@
"show_doc(TSB.predict, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_doc(TSB.predict_in_sample, title_level=3)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -9248,7 +9176,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = self.trend_forecaster.predict_in_sample(level=level)\n",
" seas = self.model_.filter(regex='seasonal*').sum(axis=1).values\n",
Expand Down Expand Up @@ -10621,7 +10549,7 @@
" Returns\n",
" -------\n",
" forecasts : dict \n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" res = {'fitted': self.model_['fitted']}\n",
" if level is not None:\n",
Expand Down Expand Up @@ -11089,7 +11017,7 @@
" Returns\n",
" -------\n",
" forecasts : dict\n",
" Dictionary with entries `mean` for point predictions and `level_*` for probabilistic predictions.\n",
" Dictionary with entries `fitted` for point predictions and `level_*` for probabilistic predictions.\n",
" \"\"\"\n",
" fitted = np.full(self.n_y, self.constant, dtype=np.float32)\n",
" res = {'fitted': fitted}\n",
Expand Down
Loading

0 comments on commit 9729006

Please sign in to comment.