|
57 | 57 | }, |
58 | 58 | { |
59 | 59 | "cell_type": "code", |
60 | | - "execution_count": 2, |
61 | | - "metadata": {}, |
| 60 | + "execution_count": null, |
| 61 | + "metadata": { |
| 62 | + "ExecuteTime": { |
| 63 | + "end_time": "2025-03-27T22:52:48.732533Z", |
| 64 | + "start_time": "2025-03-27T22:52:47.228193Z" |
| 65 | + } |
| 66 | + }, |
62 | 67 | "outputs": [], |
63 | 68 | "source": [ |
64 | 69 | "from warnings import simplefilter\n", |
|
81 | 86 | "\n", |
82 | 87 | "%matplotlib inline\n", |
83 | 88 | "\n", |
84 | | - "loss = mean_squared_error\n", |
85 | | - "\n", |
86 | | - "data_location = r\".\\datasets\"" |
| 89 | + "loss = mean_squared_error" |
87 | 90 | ] |
88 | 91 | }, |
89 | 92 | { |
|
95 | 98 | }, |
96 | 99 | { |
97 | 100 | "cell_type": "code", |
98 | | - "execution_count": 3, |
| 101 | + "execution_count": null, |
99 | 102 | "metadata": {}, |
100 | 103 | "outputs": [ |
101 | 104 | { |
102 | 105 | "name": "stderr", |
103 | 106 | "output_type": "stream", |
104 | 107 | "text": [ |
105 | | - "C:\\Users\\wilso\\Desktop\\projects\\GitHub\\sysidentpy\\sysidentpy\\model_structure_selection\\forward_regression_orthogonal_least_squares.py:618: UserWarning: n_info_values is greater than the maximum number of all regressors space considering the chosen y_lag, u_lag, and non_degree. We set as 5\n", |
| 108 | + "c:\\Users\\wilso\\Desktop\\projects\\GitHub\\sysidentpy\\sysidentpy\\model_structure_selection\\ofr_base.py:537: UserWarning: n_info_values is greater than the maximum number of all regressors space considering the chosen y_lag, u_lag, and non_degree. We set as 5\n", |
106 | 109 | " self.info_values = self.information_criterion(reg_matrix, y)\n" |
107 | 110 | ] |
108 | 111 | }, |
|
125 | 128 | } |
126 | 129 | ], |
127 | 130 | "source": [ |
128 | | - "files = [\"\\SanFrancisco_Hospital.csv\"]\n", |
129 | | - "raw = pd.read_csv(data_location + files[0])\n", |
| 131 | + "raw = pd.read_csv(\n", |
| 132 | + " \"https://raw.githubusercontent.com/wilsonrljr/sysidentpy-data/refs/heads/main/datasets/san_francisco_hospital/SanFrancisco_Hospital.csv\"\n", |
| 133 | + ")\n", |
130 | 134 | "df = pd.DataFrame()\n", |
131 | 135 | "df[\"ds\"] = pd.date_range(\"1/1/2015 1:00:00\", freq=str(60) + \"Min\", periods=8760)\n", |
132 | 136 | "df[\"y\"] = raw.iloc[:, 0].values\n", |
|
193 | 197 | } |
194 | 198 | ], |
195 | 199 | "source": [ |
196 | | - "files = [\"\\SanFrancisco_Hospital.csv\"]\n", |
197 | | - "raw = pd.read_csv(data_location + files[0])\n", |
| 200 | + "raw = pd.read_csv(\n", |
| 201 | + " \"https://raw.githubusercontent.com/wilsonrljr/sysidentpy-data/refs/heads/main/datasets/san_francisco_hospital/SanFrancisco_Hospital.csv\"\n", |
| 202 | + ")\n", |
198 | 203 | "df = pd.DataFrame()\n", |
199 | 204 | "df[\"ds\"] = pd.date_range(\"1/1/2015 1:00:00\", freq=str(60) + \"Min\", periods=8760)\n", |
200 | 205 | "df[\"y\"] = raw.iloc[:, 0].values\n", |
|
265 | 270 | ], |
266 | 271 | "source": [ |
267 | 272 | "set_random_seed(42)\n", |
268 | | - "files = [\"\\SanFrancisco_Hospital.csv\"]\n", |
269 | | - "raw = pd.read_csv(data_location + files[0])\n", |
| 273 | + "raw = pd.read_csv(\n", |
| 274 | + " \"https://raw.githubusercontent.com/wilsonrljr/sysidentpy-data/refs/heads/main/datasets/san_francisco_hospital/SanFrancisco_Hospital.csv\"\n", |
| 275 | + ")\n", |
270 | 276 | "df = pd.DataFrame()\n", |
271 | 277 | "df[\"ds\"] = pd.date_range(\"1/1/2015 1:00:00\", freq=str(60) + \"Min\", periods=8760)\n", |
272 | 278 | "df[\"y\"] = raw.iloc[:, 0].values\n", |
|
315 | 321 | "WARNING: nprophet - fit: Parts of code may break if using other than daily data.\n" |
316 | 322 | ] |
317 | 323 | }, |
318 | | - { |
319 | | - "name": "stdout", |
320 | | - "output_type": "stream", |
321 | | - "text": [ |
322 | | - "04-26 19:54:06 - WARNING - Parts of code may break if using other than daily data.\n" |
323 | | - ] |
324 | | - }, |
325 | 324 | { |
326 | 325 | "name": "stderr", |
327 | 326 | "output_type": "stream", |
328 | 327 | "text": [ |
329 | | - "INFO: nprophet.utils - set_auto_seasonalities: Disabling yearly seasonality. Run NeuralProphet with yearly_seasonality=True to override this.\n" |
330 | | - ] |
331 | | - }, |
332 | | - { |
333 | | - "name": "stdout", |
334 | | - "output_type": "stream", |
335 | | - "text": [ |
336 | | - "04-26 19:54:06 - INFO - Disabling yearly seasonality. Run NeuralProphet with yearly_seasonality=True to override this.\n" |
337 | | - ] |
338 | | - }, |
339 | | - { |
340 | | - "name": "stderr", |
341 | | - "output_type": "stream", |
342 | | - "text": [ |
343 | | - "INFO: nprophet.config - set_auto_batch_epoch: Auto-set batch_size to 32\n" |
344 | | - ] |
345 | | - }, |
346 | | - { |
347 | | - "name": "stdout", |
348 | | - "output_type": "stream", |
349 | | - "text": [ |
350 | | - "04-26 19:54:06 - INFO - Auto-set batch_size to 32\n" |
351 | | - ] |
352 | | - }, |
353 | | - { |
354 | | - "name": "stderr", |
355 | | - "output_type": "stream", |
356 | | - "text": [ |
357 | | - "INFO: nprophet.config - set_auto_batch_epoch: Auto-set epochs to 7\n" |
358 | | - ] |
359 | | - }, |
360 | | - { |
361 | | - "name": "stdout", |
362 | | - "output_type": "stream", |
363 | | - "text": [ |
364 | | - "04-26 19:54:06 - INFO - Auto-set epochs to 7\n" |
365 | | - ] |
366 | | - }, |
367 | | - { |
368 | | - "name": "stderr", |
369 | | - "output_type": "stream", |
370 | | - "text": [ |
371 | | - "Epoch[7/7]: 100%|██████████| 7/7 [00:03<00:00, 1.82it/s, SmoothL1Loss=0.0102, MAE=81.6, RegLoss=0.011] \n", |
| 328 | + "INFO: nprophet.utils - set_auto_seasonalities: Disabling yearly seasonality. Run NeuralProphet with yearly_seasonality=True to override this.\n", |
| 329 | + "INFO: nprophet.config - set_auto_batch_epoch: Auto-set batch_size to 32\n", |
| 330 | + "INFO: nprophet.config - set_auto_batch_epoch: Auto-set epochs to 7\n", |
| 331 | + "Epoch[7/7]: 100%|██████████| 7/7 [00:04<00:00, 1.74it/s, SmoothL1Loss=0.0102, MAE=81.6, RegLoss=0.011] \n", |
372 | 332 | "INFO: nprophet - _evaluate: Validation metrics: SmoothL1Loss MAE\n", |
373 | 333 | "1 0.011 84.733\n" |
374 | 334 | ] |
|
377 | 337 | "name": "stdout", |
378 | 338 | "output_type": "stream", |
379 | 339 | "text": [ |
380 | | - "04-26 19:54:10 - INFO - Validation metrics: SmoothL1Loss MAE\n", |
381 | | - "1 0.011 84.733\n", |
382 | 340 | "11397.103026422525\n" |
383 | 341 | ] |
384 | 342 | } |
385 | 343 | ], |
386 | 344 | "source": [ |
387 | 345 | "set_random_seed(42)\n", |
388 | 346 | "\n", |
389 | | - "# set_log_level(\"ERROR\")\n", |
390 | | - "files = [\"\\SanFrancisco_Hospital.csv\"]\n", |
391 | | - "raw = pd.read_csv(data_location + files[0])\n", |
| 347 | + "raw = pd.read_csv(\n", |
| 348 | + " \"https://raw.githubusercontent.com/wilsonrljr/sysidentpy-data/refs/heads/main/datasets/san_francisco_hospital/SanFrancisco_Hospital.csv\"\n", |
| 349 | + ")\n", |
392 | 350 | "df = pd.DataFrame()\n", |
393 | 351 | "df[\"ds\"] = pd.date_range(\"1/1/2015 1:00:00\", freq=str(60) + \"Min\", periods=8760)\n", |
394 | 352 | "df[\"y\"] = raw.iloc[:, 0].values\n", |
|
403 | 361 | "\n", |
404 | 362 | "future = m.make_future_dataframe(df_val, n_historic_predictions=True)\n", |
405 | 363 | "forecast = m.predict(future)\n", |
406 | | - "# fig = m.plot(forecast)\n", |
407 | 364 | "print(loss(forecast[\"y\"][24:-1], forecast[\"yhat1\"][24:-1]))\n", |
408 | 365 | "\n", |
409 | 366 | "neuralprophet_loss = loss(forecast[\"y\"][24:-1], forecast[\"yhat1\"][24:-1])" |
|
473 | 430 | } |
474 | 431 | ], |
475 | 432 | "metadata": { |
476 | | - "interpreter": { |
477 | | - "hash": "d637594906b92e2064a8978fcd7d47bb213aa9d5bb48152798bc86e8ea48bb1d" |
478 | | - }, |
479 | 433 | "kernelspec": { |
480 | | - "display_name": "Python 3.8.11 64-bit ('neural_prophet': conda)", |
| 434 | + "display_name": "neural_prophet", |
| 435 | + "language": "python", |
481 | 436 | "name": "python3" |
482 | 437 | }, |
483 | 438 | "language_info": { |
|
0 commit comments