You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Chapter5/time_series.ipynb
+159Lines changed: 159 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2249,6 +2249,165 @@
2249
2249
"[Link to NeuralForecast](https://bit.ly/44h9KM7)."
2250
2250
]
2251
2251
},
2252
+
{
2253
+
"cell_type": "markdown",
2254
+
"id": "4255da83",
2255
+
"metadata": {},
2256
+
"source": [
2257
+
"### Scaling Time-Series Forecasting with StatsForecast and Spark"
2258
+
]
2259
+
},
2260
+
{
2261
+
"cell_type": "code",
2262
+
"execution_count": null,
2263
+
"id": "f18072ef",
2264
+
"metadata": {
2265
+
"tags": [
2266
+
"hide-cell"
2267
+
]
2268
+
},
2269
+
"outputs": [],
2270
+
"source": [
2271
+
"!pip install statsforecast pyspark\n"
2272
+
]
2273
+
},
2274
+
{
2275
+
"cell_type": "code",
2276
+
"execution_count": 22,
2277
+
"id": "da891a0f",
2278
+
"metadata": {},
2279
+
"outputs": [],
2280
+
"source": [
2281
+
"import os \n",
2282
+
"\n",
2283
+
"# this makes it so that the outputs of the predict methods have the id as a column \n",
2284
+
"# instead of as the index\n",
2285
+
"os.environ['NIXTLA_ID_AS_COL'] = '1'"
2286
+
]
2287
+
},
2288
+
{
2289
+
"cell_type": "markdown",
2290
+
"id": "3d8c3905",
2291
+
"metadata": {},
2292
+
"source": [
2293
+
"Traditional time series libraries are typically built to run in-memory on single machines, which poses challenges when handling extremely large datasets.\n",
2294
+
"\n",
2295
+
"StatsForecast, however, provides seamless compatibility with Spark, allowing users to perform scalable and efficient time-series forecasting on large datasets directly within Spark."
"/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.\n",
2361
+
" warnings.warn(\n",
2362
+
"/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.\n",
2363
+
" warnings.warn(\n",
2364
+
"/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.\n",
"/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.\n",
2390
+
" warnings.warn(\n",
2391
+
"/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown\n",
2392
+
" warnings.warn('resource_tracker: There appear to be %d '\n"
<h2><span class="section-number">6.7.16. </span>Scaling Time-Series Forecasting with StatsForecast and Spark<a class="headerlink" href="#scaling-time-series-forecasting-with-statsforecast-and-spark" title="Permalink to this heading">#</a></h2>
<p>Traditional time series libraries are typically built to run in-memory on single machines, which poses challenges when handling extremely large datasets.</p>
1897
+
<p>StatsForecast, however, provides seamless compatibility with Spark, allowing users to perform scalable and efficient time-series forecasting on large datasets directly within Spark.</p>
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
1951
+
warnings.warn(
1952
+
/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
1953
+
warnings.warn(
1954
+
/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
<div class="output stderr highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/site-packages/statsforecast/core.py:485: FutureWarning: In a future version the predictions will have the id as a column. You can set the `NIXTLA_ID_AS_COL` environment variable to adopt the new behavior and to suppress this warning.
1971
+
warnings.warn(
1972
+
/Users/khuyentran/.pyenv/versions/3.8.16/lib/python3.8/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
1973
+
warnings.warn('resource_tracker: There appear to be %d '
1974
+
</pre></div>
1975
+
</div>
1976
+
</div>
1977
+
</div>
1978
+
<p><a class="reference external" href="https://bit.ly/3KNsl9P">Link to StatsForecast.</a></p>
<h2><span class="section-number">6.7.16. </span>Generative Pre-trained Forecasting with TimeGPT<a class="headerlink" href="#generative-pre-trained-forecasting-with-timegpt" title="Permalink to this heading">#</a></h2>
1981
+
<h2><span class="section-number">6.7.17. </span>Generative Pre-trained Forecasting with TimeGPT<a class="headerlink" href="#generative-pre-trained-forecasting-with-timegpt" title="Permalink to this heading">#</a></h2>
0 commit comments