|
160 | 160 | "# The 'demand' becomes 'y' representing the target variable we want to forecast\n", |
161 | 161 | "Y_df = Y_df.rename(\n", |
162 | 162 | " columns={\n", |
163 | | - " 'item_id': 'unique_id', \n", |
164 | | - " 'timestamp': 'ds', \n", |
| 163 | + " 'item_id': 'unique_id',\n", |
| 164 | + " 'timestamp': 'ds',\n", |
165 | 165 | " 'demand': 'y'\n", |
166 | 166 | " }\n", |
167 | 167 | ")\n", |
|
431 | 431 | "# Get the current time before forecasting starts, this will be used to measure the execution time\n", |
432 | 432 | "init = time()\n", |
433 | 433 | "\n", |
434 | | - "# Call the forecast method of the StatsForecast instance to predict the next 28 days (h=28) \n", |
| 434 | + "# Call the forecast method of the StatsForecast instance to predict the next 28 days (h=28)\n", |
435 | 435 | "fcst_df = sf.forecast(df=Y_df, h=28)\n", |
436 | 436 | "\n", |
437 | 437 | "# Get the current time after the forecasting ends\n", |
|
1267 | 1267 | "plot_series(\n", |
1268 | 1268 | " Y_df,\n", |
1269 | 1269 | " fcst_df,\n", |
1270 | | - " max_insample_length=28 * 3, \n", |
| 1270 | + " max_insample_length=28 * 3,\n", |
1271 | 1271 | " models=['CrostonOptimized', 'AutoNHITS', 'SeasonalNaive', 'LGBMRegressor'],\n", |
1272 | 1272 | ")" |
1273 | 1273 | ] |
|
1519 | 1519 | "source": [ |
1520 | 1520 | "init = time()\n", |
1521 | 1521 | "cv_mlf_df = mlf.cross_validation(\n", |
1522 | | - " df=Y_df, \n", |
| 1522 | + " df=Y_df,\n", |
1523 | 1523 | " h=horizon,\n", |
1524 | 1524 | " n_windows=3,\n", |
1525 | 1525 | ")\n", |
|
1897 | 1897 | "for cutoff in cutoffs:\n", |
1898 | 1898 | " display(\n", |
1899 | 1899 | " plot_series(\n", |
1900 | | - " Y_df, \n", |
1901 | | - " cv_df.query('cutoff == @cutoff').drop(columns=['y', 'cutoff']), \n", |
1902 | | - " max_insample_length=28 * 5, \n", |
| 1900 | + " Y_df,\n", |
| 1901 | + " cv_df.query('cutoff == @cutoff').drop(columns=['y', 'cutoff']),\n", |
| 1902 | + " max_insample_length=28 * 5,\n", |
1903 | 1903 | " ids=['FOODS_3_001_CA_1'],\n", |
1904 | 1904 | " )\n", |
1905 | 1905 | " )" |
|
1976 | 1976 | "for cutoff in cutoffs:\n", |
1977 | 1977 | " display(\n", |
1978 | 1978 | " plot_series(\n", |
1979 | | - " agg_Y_df, \n", |
| 1979 | + " agg_Y_df,\n", |
1980 | 1980 | " agg_cv_df.query('cutoff == @cutoff').drop(columns=['y', 'cutoff']),\n", |
1981 | 1981 | " max_insample_length=28 * 5,\n", |
1982 | 1982 | " )\n", |
|
2649 | 2649 | "source": [ |
2650 | 2650 | "plot_series(\n", |
2651 | 2651 | " Y_df,\n", |
2652 | | - " cv_df.drop(columns=['cutoff', 'y']), \n", |
2653 | | - " max_insample_length=28 * 6, \n", |
| 2652 | + " cv_df.drop(columns=['cutoff', 'y']),\n", |
| 2653 | + " max_insample_length=28 * 6,\n", |
2654 | 2654 | " models=['AutoNHITS'],\n", |
2655 | 2655 | ")" |
2656 | 2656 | ] |
|
2716 | 2716 | "id": "1394e95e-b65c-45d6-aea0-55e9e1940b60", |
2717 | 2717 | "metadata": {}, |
2718 | 2718 | "source": [ |
2719 | | - "- [Available Models StatsForecast](../../../statsforecast/models)\n", |
2720 | | - "- [Available Models NeuralForecast](../capabilities/01_overview)\n", |
2721 | | - "- [Loss Functions in NeuralForecast](../capabilities/02_objectives)\n", |
2722 | | - "- [Getting Started NeuralForecast](../getting-started/02_quickstart)\n", |
2723 | | - "- [Hierarchical Reconciliation](../../../hierarchicalforecast/examples/TourismSmall)\n", |
2724 | | - "- [Distributed ML Forecast (trees)](../../../mlforecast/docs/getting-started/quick_start_distributed)\n", |
| 2719 | + "- [Available Models StatsForecast](../../../statsforecast/models.html)\n", |
| 2720 | + "- [Available Models NeuralForecast]( ../capabilities/overview.html)\n", |
| 2721 | + "- [Loss Functions in NeuralForecast](../capabilities/objectives.html)\n", |
| 2722 | + "- [Getting Started NeuralForecast](../getting-started/quickstart.html)\n", |
| 2723 | + "- [Hierarchical Reconciliation](../../../hierarchicalforecast/examples/tourismsmall.html)\n", |
| 2724 | + "- [Distributed ML Forecast (trees)](../../../mlforecast/docs/getting-started/quick_start_distributed.html)\n", |
2725 | 2725 | "- [Using StatsForecast to train millions of time series](https://www.anyscale.com/blog/how-nixtla-uses-ray-to-accurately-predict-more-than-a-million-time-series)\n", |
2726 | 2726 | "- [Intermittent Demand Forecasting With Nixtla on Databricks](https://www.databricks.com/blog/2022/12/06/intermittent-demand-forecasting-nixtla-databricks.html)" |
2727 | 2727 | ] |
|
0 commit comments