Spaces:
Build error
Build error
Commit ·
3ebb301
1
Parent(s): a541153
Remove unnecessary files: prediction CSVs and unused scripts
Browse files- data/predictions_Current_Weekend.csv +0 -55
- data/predictions_Next_24_Hours.csv +0 -25
- data/predictions_Next_48_Hours.csv +0 -49
- data/predictions_Next_48_Hours_Auto.csv +0 -49
- data/predictions_Next_Week_7_Days.csv +0 -169
- scripts/compare_predictions.py +0 -192
- scripts/data_generator.py +0 -123
- scripts/emergency_admissions_predictor.py +0 -147
- scripts/predict.py +0 -47
- scripts/visualize.py +0 -219
data/predictions_Current_Weekend.csv
DELETED
|
@@ -1,55 +0,0 @@
|
|
| 1 |
-
datetime,predicted_emergency_admissions,predicted_icu_demand,predicted_staff_workload
|
| 2 |
-
2026-01-03 20:01:54.727429,1.8511904761904763,0.6837791,1.0812849
|
| 3 |
-
2026-01-03 21:01:54.727429,1.8511904761904763,0.0015314387,0.57848483
|
| 4 |
-
2026-01-03 22:01:54.727429,1.8511904761904763,-0.0030087454,0.40669277
|
| 5 |
-
2026-01-03 23:01:54.727429,1.8511904761904763,0.03673846,0.009536105
|
| 6 |
-
2026-01-04 00:01:54.727429,1.8511904761904763,0.07041023,0.3309968
|
| 7 |
-
2026-01-04 01:01:54.727429,1.8511904761904763,-0.016362969,-0.10803197
|
| 8 |
-
2026-01-04 02:01:54.727429,1.8511904761904763,0.14771965,0.5044662
|
| 9 |
-
2026-01-04 03:01:54.727429,1.8511904761904763,0.035325162,0.17477345
|
| 10 |
-
2026-01-04 04:01:54.727429,1.8511904761904763,0.03769674,0.025916977
|
| 11 |
-
2026-01-04 05:01:54.727429,1.8511904761904763,0.08433261,0.15435499
|
| 12 |
-
2026-01-04 06:01:54.727429,1.8511904761904763,0.04150059,0.09162672
|
| 13 |
-
2026-01-04 07:01:54.727429,1.8511904761904763,0.01106802,0.26552853
|
| 14 |
-
2026-01-04 08:01:54.727429,1.8511904761904763,0.061104525,0.1673679
|
| 15 |
-
2026-01-04 09:01:54.727429,1.8511904761904763,0.0007876241,0.17770171
|
| 16 |
-
2026-01-04 10:01:54.727429,1.8511904761904763,0.0797624,0.027998284
|
| 17 |
-
2026-01-04 11:01:54.727429,1.8511904761904763,0.008823868,0.2589002
|
| 18 |
-
2026-01-04 12:01:54.727429,1.8511904761904763,-0.019359384,0.22089961
|
| 19 |
-
2026-01-04 13:01:54.727429,1.8511904761904763,-0.046255715,0.3585882
|
| 20 |
-
2026-01-04 14:01:54.727429,1.8511904761904763,0.29936665,1.0840256
|
| 21 |
-
2026-01-04 15:01:54.727429,1.8511904761904763,0.38378263,1.2051085
|
| 22 |
-
2026-01-04 16:01:54.727429,1.8511904761904763,0.25184977,0.6845033
|
| 23 |
-
2026-01-04 17:01:54.727429,1.8511904761904763,0.46332866,0.94264126
|
| 24 |
-
2026-01-04 18:01:54.727429,1.8511904761904763,0.23085001,0.64406663
|
| 25 |
-
2026-01-04 19:01:54.727429,1.8511904761904763,0.22248834,0.8695313
|
| 26 |
-
2026-01-04 20:01:54.727429,1.8511904761904763,-0.0671031,0.48716596
|
| 27 |
-
2026-01-04 21:01:54.727429,1.8511904761904763,0.41112992,0.7704077
|
| 28 |
-
2026-01-04 22:01:54.727429,1.8511904761904763,0.000824114,0.2685413
|
| 29 |
-
2026-01-04 23:01:54.727429,1.8511904761904763,0.0040384126,0.64567906
|
| 30 |
-
2026-01-05 00:01:54.727429,1.8511904761904763,-0.013324468,0.2843667
|
| 31 |
-
2026-01-05 01:01:54.727429,1.8511904761904763,-0.06265203,0.0230423
|
| 32 |
-
2026-01-05 02:01:54.727429,1.8511904761904763,-0.046783715,0.31315714
|
| 33 |
-
2026-01-05 03:01:54.727429,1.8511904761904763,-0.020877209,0.15604892
|
| 34 |
-
2026-01-05 04:01:54.727429,1.8511904761904763,0.013056498,0.24097472
|
| 35 |
-
2026-01-05 05:01:54.727429,1.8511904761904763,0.04414215,0.03931477
|
| 36 |
-
2026-01-05 06:01:54.727429,1.8511904761904763,0.37369907,0.009717901
|
| 37 |
-
2026-01-05 07:01:54.727429,1.8511904761904763,-0.011729559,0.21620716
|
| 38 |
-
2026-01-05 08:01:54.727429,1.8511904761904763,0.0076462706,0.7143712
|
| 39 |
-
2026-01-05 09:01:54.727429,1.8511904761904763,-0.017555328,0.5357925
|
| 40 |
-
2026-01-05 10:01:54.727429,1.8511904761904763,0.110423654,0.5550465
|
| 41 |
-
2026-01-05 11:01:54.727429,1.8511904761904763,-0.034608245,0.094390094
|
| 42 |
-
2026-01-05 12:01:54.727429,1.8511904761904763,0.25977656,0.5042274
|
| 43 |
-
2026-01-05 13:01:54.727429,1.8511904761904763,0.55863285,1.336583
|
| 44 |
-
2026-01-05 14:01:54.727429,1.8511904761904763,0.3547941,0.6865614
|
| 45 |
-
2026-01-05 15:01:54.727429,1.8511904761904763,0.33942354,1.35424
|
| 46 |
-
2026-01-05 16:01:54.727429,1.8511904761904763,0.017039398,0.34210208
|
| 47 |
-
2026-01-05 17:01:54.727429,1.8511904761904763,0.2546735,0.9247641
|
| 48 |
-
2026-01-05 18:01:54.727429,1.8511904761904763,0.41423064,0.6199723
|
| 49 |
-
2026-01-05 19:01:54.727429,1.8511904761904763,0.25366646,0.9620646
|
| 50 |
-
2026-01-05 20:01:54.727429,1.8511904761904763,0.8006692,1.4931285
|
| 51 |
-
2026-01-05 21:01:54.727429,1.8511904761904763,0.90760255,2.1086142
|
| 52 |
-
2026-01-05 22:01:54.727429,1.8511904761904763,0.49078903,1.4082191
|
| 53 |
-
2026-01-05 23:01:54.727429,1.8511904761904763,0.7337919,2.274773
|
| 54 |
-
2026-01-06 00:01:54.727429,1.8511904761904763,0.27126345,0.8296799
|
| 55 |
-
2026-01-06 01:01:54.727429,1.8511904761904763,0.26952648,0.8072494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/predictions_Next_24_Hours.csv
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
datetime,predicted_emergency_admissions,predicted_icu_demand,predicted_staff_workload
|
| 2 |
-
2026-01-03 20:01:54.727429,1.8511904761904763,-0.046783715,0.31315714
|
| 3 |
-
2026-01-03 21:01:54.727429,1.8511904761904763,-0.020877209,0.15604892
|
| 4 |
-
2026-01-03 22:01:54.727429,1.8511904761904763,0.013056498,0.24097472
|
| 5 |
-
2026-01-03 23:01:54.727429,1.8511904761904763,0.04414215,0.03931477
|
| 6 |
-
2026-01-04 00:01:54.727429,1.8511904761904763,0.37369907,0.009717901
|
| 7 |
-
2026-01-04 01:01:54.727429,1.8511904761904763,-0.011729559,0.21620716
|
| 8 |
-
2026-01-04 02:01:54.727429,1.8511904761904763,0.0076462706,0.7143712
|
| 9 |
-
2026-01-04 03:01:54.727429,1.8511904761904763,-0.017555328,0.5357925
|
| 10 |
-
2026-01-04 04:01:54.727429,1.8511904761904763,0.110423654,0.5550465
|
| 11 |
-
2026-01-04 05:01:54.727429,1.8511904761904763,-0.034608245,0.094390094
|
| 12 |
-
2026-01-04 06:01:54.727429,1.8511904761904763,0.25977656,0.5042274
|
| 13 |
-
2026-01-04 07:01:54.727429,1.8511904761904763,0.55863285,1.336583
|
| 14 |
-
2026-01-04 08:01:54.727429,1.8511904761904763,0.3547941,0.6865614
|
| 15 |
-
2026-01-04 09:01:54.727429,1.8511904761904763,0.33942354,1.35424
|
| 16 |
-
2026-01-04 10:01:54.727429,1.8511904761904763,0.017039398,0.34210208
|
| 17 |
-
2026-01-04 11:01:54.727429,1.8511904761904763,0.2546735,0.9247641
|
| 18 |
-
2026-01-04 12:01:54.727429,1.8511904761904763,0.41423064,0.6199723
|
| 19 |
-
2026-01-04 13:01:54.727429,1.8511904761904763,0.25366646,0.9620646
|
| 20 |
-
2026-01-04 14:01:54.727429,1.8511904761904763,0.8006692,1.4931285
|
| 21 |
-
2026-01-04 15:01:54.727429,1.8511904761904763,0.90760255,2.1086142
|
| 22 |
-
2026-01-04 16:01:54.727429,1.8511904761904763,0.49078903,1.4082191
|
| 23 |
-
2026-01-04 17:01:54.727429,1.8511904761904763,0.7337919,2.274773
|
| 24 |
-
2026-01-04 18:01:54.727429,1.8511904761904763,0.27126345,0.8296799
|
| 25 |
-
2026-01-04 19:01:54.727429,1.8511904761904763,0.26952648,0.8072494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/predictions_Next_48_Hours.csv
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
datetime,predicted_emergency_admissions,predicted_icu_demand,predicted_staff_workload
|
| 2 |
-
2026-01-03 20:01:54.727429,1.8511904761904763,0.14771965,0.5044662
|
| 3 |
-
2026-01-03 21:01:54.727429,1.8511904761904763,0.035325162,0.17477345
|
| 4 |
-
2026-01-03 22:01:54.727429,1.8511904761904763,0.03769674,0.025916977
|
| 5 |
-
2026-01-03 23:01:54.727429,1.8511904761904763,0.08433261,0.15435499
|
| 6 |
-
2026-01-04 00:01:54.727429,1.8511904761904763,0.04150059,0.09162672
|
| 7 |
-
2026-01-04 01:01:54.727429,1.8511904761904763,0.01106802,0.26552853
|
| 8 |
-
2026-01-04 02:01:54.727429,1.8511904761904763,0.061104525,0.1673679
|
| 9 |
-
2026-01-04 03:01:54.727429,1.8511904761904763,0.0007876241,0.17770171
|
| 10 |
-
2026-01-04 04:01:54.727429,1.8511904761904763,0.0797624,0.027998284
|
| 11 |
-
2026-01-04 05:01:54.727429,1.8511904761904763,0.008823868,0.2589002
|
| 12 |
-
2026-01-04 06:01:54.727429,1.8511904761904763,-0.019359384,0.22089961
|
| 13 |
-
2026-01-04 07:01:54.727429,1.8511904761904763,-0.046255715,0.3585882
|
| 14 |
-
2026-01-04 08:01:54.727429,1.8511904761904763,0.29936665,1.0840256
|
| 15 |
-
2026-01-04 09:01:54.727429,1.8511904761904763,0.38378263,1.2051085
|
| 16 |
-
2026-01-04 10:01:54.727429,1.8511904761904763,0.25184977,0.6845033
|
| 17 |
-
2026-01-04 11:01:54.727429,1.8511904761904763,0.46332866,0.94264126
|
| 18 |
-
2026-01-04 12:01:54.727429,1.8511904761904763,0.23085001,0.64406663
|
| 19 |
-
2026-01-04 13:01:54.727429,1.8511904761904763,0.22248834,0.8695313
|
| 20 |
-
2026-01-04 14:01:54.727429,1.8511904761904763,-0.0671031,0.48716596
|
| 21 |
-
2026-01-04 15:01:54.727429,1.8511904761904763,0.41112992,0.7704077
|
| 22 |
-
2026-01-04 16:01:54.727429,1.8511904761904763,0.000824114,0.2685413
|
| 23 |
-
2026-01-04 17:01:54.727429,1.8511904761904763,0.0040384126,0.64567906
|
| 24 |
-
2026-01-04 18:01:54.727429,1.8511904761904763,-0.013324468,0.2843667
|
| 25 |
-
2026-01-04 19:01:54.727429,1.8511904761904763,-0.06265203,0.0230423
|
| 26 |
-
2026-01-04 20:01:54.727429,1.8511904761904763,-0.046783715,0.31315714
|
| 27 |
-
2026-01-04 21:01:54.727429,1.8511904761904763,-0.020877209,0.15604892
|
| 28 |
-
2026-01-04 22:01:54.727429,1.8511904761904763,0.013056498,0.24097472
|
| 29 |
-
2026-01-04 23:01:54.727429,1.8511904761904763,0.04414215,0.03931477
|
| 30 |
-
2026-01-05 00:01:54.727429,1.8511904761904763,0.37369907,0.009717901
|
| 31 |
-
2026-01-05 01:01:54.727429,1.8511904761904763,-0.011729559,0.21620716
|
| 32 |
-
2026-01-05 02:01:54.727429,1.8511904761904763,0.0076462706,0.7143712
|
| 33 |
-
2026-01-05 03:01:54.727429,1.8511904761904763,-0.017555328,0.5357925
|
| 34 |
-
2026-01-05 04:01:54.727429,1.8511904761904763,0.110423654,0.5550465
|
| 35 |
-
2026-01-05 05:01:54.727429,1.8511904761904763,-0.034608245,0.094390094
|
| 36 |
-
2026-01-05 06:01:54.727429,1.8511904761904763,0.25977656,0.5042274
|
| 37 |
-
2026-01-05 07:01:54.727429,1.8511904761904763,0.55863285,1.336583
|
| 38 |
-
2026-01-05 08:01:54.727429,1.8511904761904763,0.3547941,0.6865614
|
| 39 |
-
2026-01-05 09:01:54.727429,1.8511904761904763,0.33942354,1.35424
|
| 40 |
-
2026-01-05 10:01:54.727429,1.8511904761904763,0.017039398,0.34210208
|
| 41 |
-
2026-01-05 11:01:54.727429,1.8511904761904763,0.2546735,0.9247641
|
| 42 |
-
2026-01-05 12:01:54.727429,1.8511904761904763,0.41423064,0.6199723
|
| 43 |
-
2026-01-05 13:01:54.727429,1.8511904761904763,0.25366646,0.9620646
|
| 44 |
-
2026-01-05 14:01:54.727429,1.8511904761904763,0.8006692,1.4931285
|
| 45 |
-
2026-01-05 15:01:54.727429,1.8511904761904763,0.90760255,2.1086142
|
| 46 |
-
2026-01-05 16:01:54.727429,1.8511904761904763,0.49078903,1.4082191
|
| 47 |
-
2026-01-05 17:01:54.727429,1.8511904761904763,0.7337919,2.274773
|
| 48 |
-
2026-01-05 18:01:54.727429,1.8511904761904763,0.27126345,0.8296799
|
| 49 |
-
2026-01-05 19:01:54.727429,1.8511904761904763,0.26952648,0.8072494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/predictions_Next_48_Hours_Auto.csv
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
datetime,predicted_emergency_admissions,predicted_icu_demand,predicted_staff_workload
|
| 2 |
-
2026-01-03 20:01:54.727429,1.8511904761904763,0.14771965,0.5044662
|
| 3 |
-
2026-01-03 21:01:54.727429,1.8511904761904763,0.035325162,0.17477345
|
| 4 |
-
2026-01-03 22:01:54.727429,1.8511904761904763,0.03769674,0.025916977
|
| 5 |
-
2026-01-03 23:01:54.727429,1.8511904761904763,0.08433261,0.15435499
|
| 6 |
-
2026-01-04 00:01:54.727429,1.8511904761904763,0.04150059,0.09162672
|
| 7 |
-
2026-01-04 01:01:54.727429,1.8511904761904763,0.01106802,0.26552853
|
| 8 |
-
2026-01-04 02:01:54.727429,1.8511904761904763,0.061104525,0.1673679
|
| 9 |
-
2026-01-04 03:01:54.727429,1.8511904761904763,0.0007876241,0.17770171
|
| 10 |
-
2026-01-04 04:01:54.727429,1.8511904761904763,0.0797624,0.027998284
|
| 11 |
-
2026-01-04 05:01:54.727429,1.8511904761904763,0.008823868,0.2589002
|
| 12 |
-
2026-01-04 06:01:54.727429,1.8511904761904763,-0.019359384,0.22089961
|
| 13 |
-
2026-01-04 07:01:54.727429,1.8511904761904763,-0.046255715,0.3585882
|
| 14 |
-
2026-01-04 08:01:54.727429,1.8511904761904763,0.29936665,1.0840256
|
| 15 |
-
2026-01-04 09:01:54.727429,1.8511904761904763,0.38378263,1.2051085
|
| 16 |
-
2026-01-04 10:01:54.727429,1.8511904761904763,0.25184977,0.6845033
|
| 17 |
-
2026-01-04 11:01:54.727429,1.8511904761904763,0.46332866,0.94264126
|
| 18 |
-
2026-01-04 12:01:54.727429,1.8511904761904763,0.23085001,0.64406663
|
| 19 |
-
2026-01-04 13:01:54.727429,1.8511904761904763,0.22248834,0.8695313
|
| 20 |
-
2026-01-04 14:01:54.727429,1.8511904761904763,-0.0671031,0.48716596
|
| 21 |
-
2026-01-04 15:01:54.727429,1.8511904761904763,0.41112992,0.7704077
|
| 22 |
-
2026-01-04 16:01:54.727429,1.8511904761904763,0.000824114,0.2685413
|
| 23 |
-
2026-01-04 17:01:54.727429,1.8511904761904763,0.0040384126,0.64567906
|
| 24 |
-
2026-01-04 18:01:54.727429,1.8511904761904763,-0.013324468,0.2843667
|
| 25 |
-
2026-01-04 19:01:54.727429,1.8511904761904763,-0.06265203,0.0230423
|
| 26 |
-
2026-01-04 20:01:54.727429,1.8511904761904763,-0.046783715,0.31315714
|
| 27 |
-
2026-01-04 21:01:54.727429,1.8511904761904763,-0.020877209,0.15604892
|
| 28 |
-
2026-01-04 22:01:54.727429,1.8511904761904763,0.013056498,0.24097472
|
| 29 |
-
2026-01-04 23:01:54.727429,1.8511904761904763,0.04414215,0.03931477
|
| 30 |
-
2026-01-05 00:01:54.727429,1.8511904761904763,0.37369907,0.009717901
|
| 31 |
-
2026-01-05 01:01:54.727429,1.8511904761904763,-0.011729559,0.21620716
|
| 32 |
-
2026-01-05 02:01:54.727429,1.8511904761904763,0.0076462706,0.7143712
|
| 33 |
-
2026-01-05 03:01:54.727429,1.8511904761904763,-0.017555328,0.5357925
|
| 34 |
-
2026-01-05 04:01:54.727429,1.8511904761904763,0.110423654,0.5550465
|
| 35 |
-
2026-01-05 05:01:54.727429,1.8511904761904763,-0.034608245,0.094390094
|
| 36 |
-
2026-01-05 06:01:54.727429,1.8511904761904763,0.25977656,0.5042274
|
| 37 |
-
2026-01-05 07:01:54.727429,1.8511904761904763,0.55863285,1.336583
|
| 38 |
-
2026-01-05 08:01:54.727429,1.8511904761904763,0.3547941,0.6865614
|
| 39 |
-
2026-01-05 09:01:54.727429,1.8511904761904763,0.33942354,1.35424
|
| 40 |
-
2026-01-05 10:01:54.727429,1.8511904761904763,0.017039398,0.34210208
|
| 41 |
-
2026-01-05 11:01:54.727429,1.8511904761904763,0.2546735,0.9247641
|
| 42 |
-
2026-01-05 12:01:54.727429,1.8511904761904763,0.41423064,0.6199723
|
| 43 |
-
2026-01-05 13:01:54.727429,1.8511904761904763,0.25366646,0.9620646
|
| 44 |
-
2026-01-05 14:01:54.727429,1.8511904761904763,0.8006692,1.4931285
|
| 45 |
-
2026-01-05 15:01:54.727429,1.8511904761904763,0.90760255,2.1086142
|
| 46 |
-
2026-01-05 16:01:54.727429,1.8511904761904763,0.49078903,1.4082191
|
| 47 |
-
2026-01-05 17:01:54.727429,1.8511904761904763,0.7337919,2.274773
|
| 48 |
-
2026-01-05 18:01:54.727429,1.8511904761904763,0.27126345,0.8296799
|
| 49 |
-
2026-01-05 19:01:54.727429,1.8511904761904763,0.26952648,0.8072494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/predictions_Next_Week_7_Days.csv
DELETED
|
@@ -1,169 +0,0 @@
|
|
| 1 |
-
datetime,predicted_emergency_admissions,predicted_icu_demand,predicted_staff_workload
|
| 2 |
-
2026-01-03 20:01:54.727429,1.8511904761904763,0.16711123,-0.05676522
|
| 3 |
-
2026-01-03 21:01:54.727429,1.8511904761904763,0.23809563,0.5613027
|
| 4 |
-
2026-01-03 22:01:54.727429,1.8511904761904763,-0.015030537,0.3560763
|
| 5 |
-
2026-01-03 23:01:54.727429,1.8511904761904763,-0.027441263,-0.06664164
|
| 6 |
-
2026-01-04 00:01:54.727429,1.8511904761904763,0.24516271,0.84016794
|
| 7 |
-
2026-01-04 01:01:54.727429,1.8511904761904763,0.026039017,0.020360386
|
| 8 |
-
2026-01-04 02:01:54.727429,1.8511904761904763,0.41497785,0.8753252
|
| 9 |
-
2026-01-04 03:01:54.727429,1.8511904761904763,-0.037282396,0.048277006
|
| 10 |
-
2026-01-04 04:01:54.727429,1.8511904761904763,0.5218017,0.6505697
|
| 11 |
-
2026-01-04 05:01:54.727429,1.8511904761904763,-0.0010243563,-0.026307909
|
| 12 |
-
2026-01-04 06:01:54.727429,1.8511904761904763,0.73867816,1.4324422
|
| 13 |
-
2026-01-04 07:01:54.727429,1.8511904761904763,0.10135795,0.36957538
|
| 14 |
-
2026-01-04 08:01:54.727429,1.8511904761904763,0.8841107,1.7499824
|
| 15 |
-
2026-01-04 09:01:54.727429,1.8511904761904763,0.41575915,1.0143486
|
| 16 |
-
2026-01-04 10:01:54.727429,1.8511904761904763,0.01585423,0.5576176
|
| 17 |
-
2026-01-04 11:01:54.727429,1.8511904761904763,0.680214,1.5180483
|
| 18 |
-
2026-01-04 12:01:54.727429,1.8511904761904763,0.98137516,2.2043133
|
| 19 |
-
2026-01-04 13:01:54.727429,1.8511904761904763,0.9434725,1.514512
|
| 20 |
-
2026-01-04 14:01:54.727429,1.8511904761904763,0.64557,1.1800373
|
| 21 |
-
2026-01-04 15:01:54.727429,1.8511904761904763,0.5114943,0.9769659
|
| 22 |
-
2026-01-04 16:01:54.727429,1.8511904761904763,0.110038064,0.19120356
|
| 23 |
-
2026-01-04 17:01:54.727429,1.8511904761904763,0.044258464,0.5329291
|
| 24 |
-
2026-01-04 18:01:54.727429,1.8511904761904763,-0.04493141,0.17622958
|
| 25 |
-
2026-01-04 19:01:54.727429,1.8511904761904763,0.15261811,0.43444055
|
| 26 |
-
2026-01-04 20:01:54.727429,1.8511904761904763,-0.04499425,0.679378
|
| 27 |
-
2026-01-04 21:01:54.727429,1.8511904761904763,0.060131337,-0.008271349
|
| 28 |
-
2026-01-04 22:01:54.727429,1.8511904761904763,0.23572803,0.85977805
|
| 29 |
-
2026-01-04 23:01:54.727429,1.8511904761904763,-0.05951807,0.2288866
|
| 30 |
-
2026-01-05 00:01:54.727429,1.8511904761904763,0.0013675694,0.12297985
|
| 31 |
-
2026-01-05 01:01:54.727429,1.8511904761904763,0.04160405,0.6536843
|
| 32 |
-
2026-01-05 02:01:54.727429,1.8511904761904763,0.059862226,0.27190435
|
| 33 |
-
2026-01-05 03:01:54.727429,1.8511904761904763,0.020274146,0.04551112
|
| 34 |
-
2026-01-05 04:01:54.727429,1.8511904761904763,0.029762378,0.24318805
|
| 35 |
-
2026-01-05 05:01:54.727429,1.8511904761904763,-0.015885219,0.32022694
|
| 36 |
-
2026-01-05 06:01:54.727429,1.8511904761904763,0.039947193,0.46455717
|
| 37 |
-
2026-01-05 07:01:54.727429,1.8511904761904763,0.53780574,0.8961083
|
| 38 |
-
2026-01-05 08:01:54.727429,1.8511904761904763,0.4426041,0.9832277
|
| 39 |
-
2026-01-05 09:01:54.727429,1.8511904761904763,0.08772796,0.4400076
|
| 40 |
-
2026-01-05 10:01:54.727429,1.8511904761904763,0.40821946,0.4261972
|
| 41 |
-
2026-01-05 11:01:54.727429,1.8511904761904763,-0.0017448067,0.5513622
|
| 42 |
-
2026-01-05 12:01:54.727429,1.8511904761904763,-0.023329588,0.11865444
|
| 43 |
-
2026-01-05 13:01:54.727429,1.8511904761904763,0.017126635,0.5288313
|
| 44 |
-
2026-01-05 14:01:54.727429,1.8511904761904763,0.0042125885,0.19921544
|
| 45 |
-
2026-01-05 15:01:54.727429,1.8511904761904763,0.30775723,0.69166034
|
| 46 |
-
2026-01-05 16:01:54.727429,1.8511904761904763,0.033853892,0.0964785
|
| 47 |
-
2026-01-05 17:01:54.727429,1.8511904761904763,0.30003536,0.70292974
|
| 48 |
-
2026-01-05 18:01:54.727429,1.8511904761904763,0.13987379,0.55798686
|
| 49 |
-
2026-01-05 19:01:54.727429,1.8511904761904763,-0.043660484,0.0058952435
|
| 50 |
-
2026-01-05 20:01:54.727429,1.8511904761904763,0.27068883,0.8263014
|
| 51 |
-
2026-01-05 21:01:54.727429,1.8511904761904763,0.30949056,0.76651716
|
| 52 |
-
2026-01-05 22:01:54.727429,1.8511904761904763,0.121107094,0.45636407
|
| 53 |
-
2026-01-05 23:01:54.727429,1.8511904761904763,0.39968586,0.6624997
|
| 54 |
-
2026-01-06 00:01:54.727429,1.8511904761904763,0.18393953,0.7907505
|
| 55 |
-
2026-01-06 01:01:54.727429,1.8511904761904763,-0.015124797,0.67423564
|
| 56 |
-
2026-01-06 02:01:54.727429,1.8511904761904763,0.0909034,0.18552387
|
| 57 |
-
2026-01-06 03:01:54.727429,1.8511904761904763,0.16159329,0.22145866
|
| 58 |
-
2026-01-06 04:01:54.727429,1.8511904761904763,0.042053267,0.088539615
|
| 59 |
-
2026-01-06 05:01:54.727429,1.8511904761904763,0.31881332,0.6419583
|
| 60 |
-
2026-01-06 06:01:54.727429,1.8511904761904763,-0.00014513712,-0.052177463
|
| 61 |
-
2026-01-06 07:01:54.727429,1.8511904761904763,-0.026864538,0.54857504
|
| 62 |
-
2026-01-06 08:01:54.727429,1.8511904761904763,0.13692711,0.621012
|
| 63 |
-
2026-01-06 09:01:54.727429,1.8511904761904763,0.08245306,0.28434563
|
| 64 |
-
2026-01-06 10:01:54.727429,1.8511904761904763,0.03193872,0.5016791
|
| 65 |
-
2026-01-06 11:01:54.727429,1.8511904761904763,0.0052655507,0.60221523
|
| 66 |
-
2026-01-06 12:01:54.727429,1.8511904761904763,0.6703716,1.6241696
|
| 67 |
-
2026-01-06 13:01:54.727429,1.8511904761904763,0.14163043,0.6446874
|
| 68 |
-
2026-01-06 14:01:54.727429,1.8511904761904763,0.8214776,1.5739459
|
| 69 |
-
2026-01-06 15:01:54.727429,1.8511904761904763,0.30830967,0.687604
|
| 70 |
-
2026-01-06 16:01:54.727429,1.8511904761904763,0.6952881,1.651728
|
| 71 |
-
2026-01-06 17:01:54.727429,1.8511904761904763,0.6772458,1.4237005
|
| 72 |
-
2026-01-06 18:01:54.727429,1.8511904761904763,0.6735665,2.2567267
|
| 73 |
-
2026-01-06 19:01:54.727429,1.8511904761904763,0.6245936,1.2617451
|
| 74 |
-
2026-01-06 20:01:54.727429,1.8511904761904763,0.29235876,0.56069165
|
| 75 |
-
2026-01-06 21:01:54.727429,1.8511904761904763,0.037912857,0.029774772
|
| 76 |
-
2026-01-06 22:01:54.727429,1.8511904761904763,0.0006211057,-0.0024309228
|
| 77 |
-
2026-01-06 23:01:54.727429,1.8511904761904763,0.0125262095,0.49224055
|
| 78 |
-
2026-01-07 00:01:54.727429,1.8511904761904763,0.07738231,0.25968695
|
| 79 |
-
2026-01-07 01:01:54.727429,1.8511904761904763,0.1508888,0.52532744
|
| 80 |
-
2026-01-07 02:01:54.727429,1.8511904761904763,-0.009379032,0.05913456
|
| 81 |
-
2026-01-07 03:01:54.727429,1.8511904761904763,0.028096797,0.13971503
|
| 82 |
-
2026-01-07 04:01:54.727429,1.8511904761904763,-0.0028897722,0.035668496
|
| 83 |
-
2026-01-07 05:01:54.727429,1.8511904761904763,0.005176758,0.019116817
|
| 84 |
-
2026-01-07 06:01:54.727429,1.8511904761904763,0.66443366,0.8893655
|
| 85 |
-
2026-01-07 07:01:54.727429,1.8511904761904763,0.13710034,0.8388018
|
| 86 |
-
2026-01-07 08:01:54.727429,1.8511904761904763,0.66277885,1.2761595
|
| 87 |
-
2026-01-07 09:01:54.727429,1.8511904761904763,0.48067543,1.027115
|
| 88 |
-
2026-01-07 10:01:54.727429,1.8511904761904763,0.66759956,1.2679433
|
| 89 |
-
2026-01-07 11:01:54.727429,1.8511904761904763,1.413016,2.666932
|
| 90 |
-
2026-01-07 12:01:54.727429,1.8511904761904763,0.63570267,1.938356
|
| 91 |
-
2026-01-07 13:01:54.727429,1.8511904761904763,2.0741026,3.3654048
|
| 92 |
-
2026-01-07 14:01:54.727429,1.8511904761904763,0.7550563,0.6475589
|
| 93 |
-
2026-01-07 15:01:54.727429,1.8511904761904763,0.98027694,1.1981444
|
| 94 |
-
2026-01-07 16:01:54.727429,1.8511904761904763,-0.049829707,0.049419228
|
| 95 |
-
2026-01-07 17:01:54.727429,1.8511904761904763,0.37397683,0.7713111
|
| 96 |
-
2026-01-07 18:01:54.727429,1.8511904761904763,0.22953668,0.30292514
|
| 97 |
-
2026-01-07 19:01:54.727429,1.8511904761904763,0.0922635,0.18470708
|
| 98 |
-
2026-01-07 20:01:54.727429,1.8511904761904763,0.23658472,0.48473203
|
| 99 |
-
2026-01-07 21:01:54.727429,1.8511904761904763,0.0059197224,-0.029040812
|
| 100 |
-
2026-01-07 22:01:54.727429,1.8511904761904763,0.18034875,0.47250703
|
| 101 |
-
2026-01-07 23:01:54.727429,1.8511904761904763,0.056129947,0.20020348
|
| 102 |
-
2026-01-08 00:01:54.727429,1.8511904761904763,-0.006729746,0.4568517
|
| 103 |
-
2026-01-08 01:01:54.727429,1.8511904761904763,-0.006285989,0.18559098
|
| 104 |
-
2026-01-08 02:01:54.727429,1.8511904761904763,0.18481287,0.2607244
|
| 105 |
-
2026-01-08 03:01:54.727429,1.8511904761904763,0.046784516,0.0818868
|
| 106 |
-
2026-01-08 04:01:54.727429,1.8511904761904763,0.0637247,-0.040680557
|
| 107 |
-
2026-01-08 05:01:54.727429,1.8511904761904763,0.12827277,0.11450266
|
| 108 |
-
2026-01-08 06:01:54.727429,1.8511904761904763,-0.004476241,0.029179627
|
| 109 |
-
2026-01-08 07:01:54.727429,1.8511904761904763,0.69076735,1.0934484
|
| 110 |
-
2026-01-08 08:01:54.727429,1.8511904761904763,0.20836064,0.38317826
|
| 111 |
-
2026-01-08 09:01:54.727429,1.8511904761904763,0.47516993,1.5735811
|
| 112 |
-
2026-01-08 10:01:54.727429,1.8511904761904763,0.055289235,0.90215987
|
| 113 |
-
2026-01-08 11:01:54.727429,1.8511904761904763,0.14111638,0.62369597
|
| 114 |
-
2026-01-08 12:01:54.727429,1.8511904761904763,0.29123738,0.47810504
|
| 115 |
-
2026-01-08 13:01:54.727429,1.8511904761904763,0.4996144,0.84940016
|
| 116 |
-
2026-01-08 14:01:54.727429,1.8511904761904763,0.6837791,1.0812849
|
| 117 |
-
2026-01-08 15:01:54.727429,1.8511904761904763,0.0015314387,0.57848483
|
| 118 |
-
2026-01-08 16:01:54.727429,1.8511904761904763,-0.0030087454,0.40669277
|
| 119 |
-
2026-01-08 17:01:54.727429,1.8511904761904763,0.03673846,0.009536105
|
| 120 |
-
2026-01-08 18:01:54.727429,1.8511904761904763,0.07041023,0.3309968
|
| 121 |
-
2026-01-08 19:01:54.727429,1.8511904761904763,-0.016362969,-0.10803197
|
| 122 |
-
2026-01-08 20:01:54.727429,1.8511904761904763,0.14771965,0.5044662
|
| 123 |
-
2026-01-08 21:01:54.727429,1.8511904761904763,0.035325162,0.17477345
|
| 124 |
-
2026-01-08 22:01:54.727429,1.8511904761904763,0.03769674,0.025916977
|
| 125 |
-
2026-01-08 23:01:54.727429,1.8511904761904763,0.08433261,0.15435499
|
| 126 |
-
2026-01-09 00:01:54.727429,1.8511904761904763,0.04150059,0.09162672
|
| 127 |
-
2026-01-09 01:01:54.727429,1.8511904761904763,0.01106802,0.26552853
|
| 128 |
-
2026-01-09 02:01:54.727429,1.8511904761904763,0.061104525,0.1673679
|
| 129 |
-
2026-01-09 03:01:54.727429,1.8511904761904763,0.0007876241,0.17770171
|
| 130 |
-
2026-01-09 04:01:54.727429,1.8511904761904763,0.0797624,0.027998284
|
| 131 |
-
2026-01-09 05:01:54.727429,1.8511904761904763,0.008823868,0.2589002
|
| 132 |
-
2026-01-09 06:01:54.727429,1.8511904761904763,-0.019359384,0.22089961
|
| 133 |
-
2026-01-09 07:01:54.727429,1.8511904761904763,-0.046255715,0.3585882
|
| 134 |
-
2026-01-09 08:01:54.727429,1.8511904761904763,0.29936665,1.0840256
|
| 135 |
-
2026-01-09 09:01:54.727429,1.8511904761904763,0.38378263,1.2051085
|
| 136 |
-
2026-01-09 10:01:54.727429,1.8511904761904763,0.25184977,0.6845033
|
| 137 |
-
2026-01-09 11:01:54.727429,1.8511904761904763,0.46332866,0.94264126
|
| 138 |
-
2026-01-09 12:01:54.727429,1.8511904761904763,0.23085001,0.64406663
|
| 139 |
-
2026-01-09 13:01:54.727429,1.8511904761904763,0.22248834,0.8695313
|
| 140 |
-
2026-01-09 14:01:54.727429,1.8511904761904763,-0.0671031,0.48716596
|
| 141 |
-
2026-01-09 15:01:54.727429,1.8511904761904763,0.41112992,0.7704077
|
| 142 |
-
2026-01-09 16:01:54.727429,1.8511904761904763,0.000824114,0.2685413
|
| 143 |
-
2026-01-09 17:01:54.727429,1.8511904761904763,0.0040384126,0.64567906
|
| 144 |
-
2026-01-09 18:01:54.727429,1.8511904761904763,-0.013324468,0.2843667
|
| 145 |
-
2026-01-09 19:01:54.727429,1.8511904761904763,-0.06265203,0.0230423
|
| 146 |
-
2026-01-09 20:01:54.727429,1.8511904761904763,-0.046783715,0.31315714
|
| 147 |
-
2026-01-09 21:01:54.727429,1.8511904761904763,-0.020877209,0.15604892
|
| 148 |
-
2026-01-09 22:01:54.727429,1.8511904761904763,0.013056498,0.24097472
|
| 149 |
-
2026-01-09 23:01:54.727429,1.8511904761904763,0.04414215,0.03931477
|
| 150 |
-
2026-01-10 00:01:54.727429,1.8511904761904763,0.37369907,0.009717901
|
| 151 |
-
2026-01-10 01:01:54.727429,1.8511904761904763,-0.011729559,0.21620716
|
| 152 |
-
2026-01-10 02:01:54.727429,1.8511904761904763,0.0076462706,0.7143712
|
| 153 |
-
2026-01-10 03:01:54.727429,1.8511904761904763,-0.017555328,0.5357925
|
| 154 |
-
2026-01-10 04:01:54.727429,1.8511904761904763,0.110423654,0.5550465
|
| 155 |
-
2026-01-10 05:01:54.727429,1.8511904761904763,-0.034608245,0.094390094
|
| 156 |
-
2026-01-10 06:01:54.727429,1.8511904761904763,0.25977656,0.5042274
|
| 157 |
-
2026-01-10 07:01:54.727429,1.8511904761904763,0.55863285,1.336583
|
| 158 |
-
2026-01-10 08:01:54.727429,1.8511904761904763,0.3547941,0.6865614
|
| 159 |
-
2026-01-10 09:01:54.727429,1.8511904761904763,0.33942354,1.35424
|
| 160 |
-
2026-01-10 10:01:54.727429,1.8511904761904763,0.017039398,0.34210208
|
| 161 |
-
2026-01-10 11:01:54.727429,1.8511904761904763,0.2546735,0.9247641
|
| 162 |
-
2026-01-10 12:01:54.727429,1.8511904761904763,0.41423064,0.6199723
|
| 163 |
-
2026-01-10 13:01:54.727429,1.8511904761904763,0.25366646,0.9620646
|
| 164 |
-
2026-01-10 14:01:54.727429,1.8511904761904763,0.8006692,1.4931285
|
| 165 |
-
2026-01-10 15:01:54.727429,1.8511904761904763,0.90760255,2.1086142
|
| 166 |
-
2026-01-10 16:01:54.727429,1.8511904761904763,0.49078903,1.4082191
|
| 167 |
-
2026-01-10 17:01:54.727429,1.8511904761904763,0.7337919,2.274773
|
| 168 |
-
2026-01-10 18:01:54.727429,1.8511904761904763,0.27126345,0.8296799
|
| 169 |
-
2026-01-10 19:01:54.727429,1.8511904761904763,0.26952648,0.8072494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/compare_predictions.py
DELETED
|
@@ -1,192 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Compare predictions across different time periods
|
| 3 |
-
"""
|
| 4 |
-
|
| 5 |
-
import pandas as pd
|
| 6 |
-
import matplotlib.pyplot as plt
|
| 7 |
-
import seaborn as sns
|
| 8 |
-
from glob import glob
|
| 9 |
-
import os
|
| 10 |
-
|
| 11 |
-
def compare_all_periods():
|
| 12 |
-
"""Create comparison visualization for all prediction periods"""
|
| 13 |
-
|
| 14 |
-
print("Loading all prediction files...")
|
| 15 |
-
|
| 16 |
-
# Find all prediction files
|
| 17 |
-
pred_files = glob('predictions_*.csv')
|
| 18 |
-
|
| 19 |
-
if not pred_files:
|
| 20 |
-
print("No prediction files found. Run predictions first!")
|
| 21 |
-
return
|
| 22 |
-
|
| 23 |
-
fig, axes = plt.subplots(2, 2, figsize=(16, 10))
|
| 24 |
-
fig.suptitle('Hospital Prediction Comparison: All Time Periods',
|
| 25 |
-
fontsize=16, fontweight='bold', y=0.995)
|
| 26 |
-
|
| 27 |
-
colors = sns.color_palette("husl", len(pred_files))
|
| 28 |
-
|
| 29 |
-
# 1. Emergency Admissions Comparison
|
| 30 |
-
ax1 = axes[0, 0]
|
| 31 |
-
for i, file in enumerate(sorted(pred_files)):
|
| 32 |
-
df = pd.read_csv(file)
|
| 33 |
-
df['datetime'] = pd.to_datetime(df['datetime'])
|
| 34 |
-
period_name = file.replace('predictions_', '').replace('.csv', '').replace('_', ' ')
|
| 35 |
-
|
| 36 |
-
# Plot first 48 hours for comparison
|
| 37 |
-
plot_df = df.head(48)
|
| 38 |
-
ax1.plot(range(len(plot_df)), plot_df['predicted_emergency_admissions'],
|
| 39 |
-
label=period_name, linewidth=2, alpha=0.8, color=colors[i])
|
| 40 |
-
|
| 41 |
-
ax1.set_title('Emergency Admissions Forecast', fontsize=12, fontweight='bold')
|
| 42 |
-
ax1.set_xlabel('Hours Ahead')
|
| 43 |
-
ax1.set_ylabel('Admissions per Hour')
|
| 44 |
-
ax1.legend(loc='best', fontsize=8)
|
| 45 |
-
ax1.grid(True, alpha=0.3)
|
| 46 |
-
|
| 47 |
-
# 2. ICU Demand Comparison
|
| 48 |
-
ax2 = axes[0, 1]
|
| 49 |
-
for i, file in enumerate(sorted(pred_files)):
|
| 50 |
-
df = pd.read_csv(file)
|
| 51 |
-
period_name = file.replace('predictions_', '').replace('.csv', '').replace('_', ' ')
|
| 52 |
-
plot_df = df.head(48)
|
| 53 |
-
ax2.plot(range(len(plot_df)), plot_df['predicted_icu_demand'],
|
| 54 |
-
label=period_name, linewidth=2, alpha=0.8, color=colors[i])
|
| 55 |
-
|
| 56 |
-
ax2.axhline(y=20, color='red', linestyle='--', label='ICU Capacity', linewidth=2)
|
| 57 |
-
ax2.set_title('ICU Demand Forecast', fontsize=12, fontweight='bold')
|
| 58 |
-
ax2.set_xlabel('Hours Ahead')
|
| 59 |
-
ax2.set_ylabel('ICU Beds Needed')
|
| 60 |
-
ax2.legend(loc='best', fontsize=8)
|
| 61 |
-
ax2.grid(True, alpha=0.3)
|
| 62 |
-
|
| 63 |
-
# 3. Staff Workload Comparison
|
| 64 |
-
ax3 = axes[1, 0]
|
| 65 |
-
for i, file in enumerate(sorted(pred_files)):
|
| 66 |
-
df = pd.read_csv(file)
|
| 67 |
-
period_name = file.replace('predictions_', '').replace('.csv', '').replace('_', ' ')
|
| 68 |
-
plot_df = df.head(48)
|
| 69 |
-
ax3.plot(range(len(plot_df)), plot_df['predicted_staff_workload'],
|
| 70 |
-
label=period_name, linewidth=2, alpha=0.8, color=colors[i])
|
| 71 |
-
|
| 72 |
-
ax3.set_title('Staff Workload Forecast', fontsize=12, fontweight='bold')
|
| 73 |
-
ax3.set_xlabel('Hours Ahead')
|
| 74 |
-
ax3.set_ylabel('Staff Required')
|
| 75 |
-
ax3.legend(loc='best', fontsize=8)
|
| 76 |
-
ax3.grid(True, alpha=0.3)
|
| 77 |
-
|
| 78 |
-
# 4. Summary Statistics Table
|
| 79 |
-
ax4 = axes[1, 1]
|
| 80 |
-
ax4.axis('off')
|
| 81 |
-
|
| 82 |
-
# Create summary table
|
| 83 |
-
summary_data = []
|
| 84 |
-
for file in sorted(pred_files):
|
| 85 |
-
df = pd.read_csv(file)
|
| 86 |
-
period_name = file.replace('predictions_', '').replace('.csv', '').replace('_', ' ')
|
| 87 |
-
|
| 88 |
-
summary_data.append([
|
| 89 |
-
period_name,
|
| 90 |
-
len(df),
|
| 91 |
-
f"{df['predicted_emergency_admissions'].sum():.0f}",
|
| 92 |
-
f"{df['predicted_icu_demand'].max():.1f}",
|
| 93 |
-
f"{df['predicted_staff_workload'].max():.0f}"
|
| 94 |
-
])
|
| 95 |
-
|
| 96 |
-
table = ax4.table(cellText=summary_data,
|
| 97 |
-
colLabels=['Period', 'Hours', 'Total Admits', 'Peak ICU', 'Peak Staff'],
|
| 98 |
-
cellLoc='center',
|
| 99 |
-
loc='center',
|
| 100 |
-
colWidths=[0.25, 0.15, 0.15, 0.15, 0.15])
|
| 101 |
-
|
| 102 |
-
table.auto_set_font_size(False)
|
| 103 |
-
table.set_fontsize(9)
|
| 104 |
-
table.scale(1, 2)
|
| 105 |
-
|
| 106 |
-
# Style header
|
| 107 |
-
for i in range(5):
|
| 108 |
-
table[(0, i)].set_facecolor('#2E86AB')
|
| 109 |
-
table[(0, i)].set_text_props(weight='bold', color='white')
|
| 110 |
-
|
| 111 |
-
# Style rows
|
| 112 |
-
for i in range(1, len(summary_data) + 1):
|
| 113 |
-
for j in range(5):
|
| 114 |
-
if i % 2 == 0:
|
| 115 |
-
table[(i, j)].set_facecolor('#F0F0F0')
|
| 116 |
-
|
| 117 |
-
ax4.set_title('Summary Statistics', fontsize=12, fontweight='bold', pad=20)
|
| 118 |
-
|
| 119 |
-
plt.tight_layout()
|
| 120 |
-
plt.savefig('prediction_comparison.png', dpi=300, bbox_inches='tight')
|
| 121 |
-
print("✓ Comparison chart saved as prediction_comparison.png")
|
| 122 |
-
|
| 123 |
-
# Create individual period summaries
|
| 124 |
-
create_period_summary_cards()
|
| 125 |
-
|
| 126 |
-
def create_period_summary_cards():
|
| 127 |
-
"""Create summary cards for each period"""
|
| 128 |
-
|
| 129 |
-
fig, axes = plt.subplots(2, 3, figsize=(15, 8))
|
| 130 |
-
fig.suptitle('Prediction Period Summary Cards', fontsize=16, fontweight='bold')
|
| 131 |
-
axes = axes.flatten()
|
| 132 |
-
|
| 133 |
-
pred_files = sorted(glob('predictions_*.csv'))[:6] # Max 6 cards
|
| 134 |
-
|
| 135 |
-
for idx, file in enumerate(pred_files):
|
| 136 |
-
if idx >= 6:
|
| 137 |
-
break
|
| 138 |
-
|
| 139 |
-
ax = axes[idx]
|
| 140 |
-
df = pd.read_csv(file)
|
| 141 |
-
period_name = file.replace('predictions_', '').replace('.csv', '').replace('_', ' ')
|
| 142 |
-
|
| 143 |
-
# Calculate statistics
|
| 144 |
-
total_admits = int(df['predicted_emergency_admissions'].sum())
|
| 145 |
-
peak_icu = df['predicted_icu_demand'].max()
|
| 146 |
-
peak_staff = int(df['predicted_staff_workload'].max())
|
| 147 |
-
hours = len(df)
|
| 148 |
-
|
| 149 |
-
# Determine status color
|
| 150 |
-
status_color = '#06A77D' if peak_icu < 17 else '#F18F01' if peak_icu < 19 else '#E63946'
|
| 151 |
-
|
| 152 |
-
# Clear axis
|
| 153 |
-
ax.axis('off')
|
| 154 |
-
ax.set_xlim(0, 1)
|
| 155 |
-
ax.set_ylim(0, 1)
|
| 156 |
-
|
| 157 |
-
# Add colored background
|
| 158 |
-
ax.add_patch(plt.Rectangle((0.05, 0.05), 0.9, 0.9,
|
| 159 |
-
facecolor=status_color, alpha=0.1, edgecolor=status_color, linewidth=2))
|
| 160 |
-
|
| 161 |
-
# Add text
|
| 162 |
-
ax.text(0.5, 0.85, period_name, ha='center', va='top',
|
| 163 |
-
fontsize=12, fontweight='bold', color=status_color)
|
| 164 |
-
ax.text(0.5, 0.68, f'{hours} hours', ha='center', va='top', fontsize=10, color='gray')
|
| 165 |
-
|
| 166 |
-
ax.text(0.5, 0.52, f'{total_admits}', ha='center', va='center',
|
| 167 |
-
fontsize=24, fontweight='bold', color='#2E86AB')
|
| 168 |
-
ax.text(0.5, 0.42, 'Total Admissions', ha='center', va='center', fontsize=8, color='gray')
|
| 169 |
-
|
| 170 |
-
ax.text(0.25, 0.25, f'{peak_icu:.1f}', ha='center', va='center',
|
| 171 |
-
fontsize=18, fontweight='bold', color='#A23B72')
|
| 172 |
-
ax.text(0.25, 0.15, 'Peak ICU', ha='center', va='center', fontsize=7, color='gray')
|
| 173 |
-
|
| 174 |
-
ax.text(0.75, 0.25, f'{peak_staff}', ha='center', va='center',
|
| 175 |
-
fontsize=18, fontweight='bold', color='#F18F01')
|
| 176 |
-
ax.text(0.75, 0.15, 'Peak Staff', ha='center', va='center', fontsize=7, color='gray')
|
| 177 |
-
|
| 178 |
-
# Hide unused subplots
|
| 179 |
-
for idx in range(len(pred_files), 6):
|
| 180 |
-
axes[idx].axis('off')
|
| 181 |
-
|
| 182 |
-
plt.tight_layout()
|
| 183 |
-
plt.savefig('period_summary_cards.png', dpi=300, bbox_inches='tight')
|
| 184 |
-
print("✓ Summary cards saved as period_summary_cards.png")
|
| 185 |
-
|
| 186 |
-
if __name__ == "__main__":
|
| 187 |
-
print("=== Creating Prediction Comparison Visualizations ===\n")
|
| 188 |
-
compare_all_periods()
|
| 189 |
-
print("\n✓ All comparison visualizations created!")
|
| 190 |
-
print("\nGenerated files:")
|
| 191 |
-
print(" • prediction_comparison.png - Side-by-side comparison")
|
| 192 |
-
print(" • period_summary_cards.png - Quick reference cards")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/data_generator.py
DELETED
|
@@ -1,123 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Generate realistic mock hospital data with seasonality and external factors
|
| 3 |
-
"""
|
| 4 |
-
|
| 5 |
-
import pandas as pd
|
| 6 |
-
import numpy as np
|
| 7 |
-
from datetime import datetime, timedelta
|
| 8 |
-
import config
|
| 9 |
-
|
| 10 |
-
np.random.seed(42)
|
| 11 |
-
|
| 12 |
-
def generate_hospital_data(days=180):
|
| 13 |
-
"""Generate synthetic hospital data with realistic patterns"""
|
| 14 |
-
|
| 15 |
-
# Date range
|
| 16 |
-
end_date = datetime.now()
|
| 17 |
-
start_date = end_date - timedelta(days=days)
|
| 18 |
-
dates = pd.date_range(start=start_date, end=end_date, freq='H')
|
| 19 |
-
|
| 20 |
-
df = pd.DataFrame({'datetime': dates})
|
| 21 |
-
df['date'] = df['datetime'].dt.date
|
| 22 |
-
df['hour'] = df['datetime'].dt.hour
|
| 23 |
-
df['day_of_week'] = df['datetime'].dt.dayofweek
|
| 24 |
-
df['month'] = df['datetime'].dt.month
|
| 25 |
-
df['is_weekend'] = df['day_of_week'].isin([5, 6]).astype(int)
|
| 26 |
-
|
| 27 |
-
# Time-based patterns
|
| 28 |
-
# More admissions in winter (flu season) and evening hours
|
| 29 |
-
seasonal_factor = 1 + 0.3 * np.sin(2 * np.pi * df['month'] / 12 - np.pi/2) # Peak in Dec-Jan
|
| 30 |
-
hourly_factor = 1 + 0.4 * np.sin(2 * np.pi * (df['hour'] - 6) / 24) # Peak 6 PM
|
| 31 |
-
weekend_factor = 1 + 0.2 * df['is_weekend']
|
| 32 |
-
|
| 33 |
-
# External factors (covariates)
|
| 34 |
-
df['temperature'] = 20 + 10 * np.sin(2 * np.pi * df['month'] / 12) + np.random.normal(0, 3, len(df))
|
| 35 |
-
df['flu_season_index'] = (df['month'].isin([11, 12, 1, 2])).astype(float) * 0.7 + np.random.uniform(0, 0.3, len(df))
|
| 36 |
-
df['air_quality_index'] = 50 + 30 * np.random.random(len(df)) + 20 * (df['month'].isin([6, 7, 8])).astype(int)
|
| 37 |
-
|
| 38 |
-
# Emergency Admissions (main target)
|
| 39 |
-
base_admissions = config.BASE_EMERGENCY_ADMISSIONS / 24 # Per hour
|
| 40 |
-
df['emergency_admissions'] = (
|
| 41 |
-
base_admissions *
|
| 42 |
-
seasonal_factor *
|
| 43 |
-
hourly_factor *
|
| 44 |
-
weekend_factor *
|
| 45 |
-
(1 + 0.2 * df['flu_season_index']) *
|
| 46 |
-
np.random.gamma(2, 0.5, len(df))
|
| 47 |
-
).round().astype(int)
|
| 48 |
-
|
| 49 |
-
# ICU Demand (15-20% of emergency admissions need ICU)
|
| 50 |
-
icu_rate = 0.15 + 0.05 * df['flu_season_index']
|
| 51 |
-
df['icu_demand'] = (df['emergency_admissions'] * icu_rate).round().astype(int)
|
| 52 |
-
df['icu_demand'] = df['icu_demand'].clip(upper=config.ICU_CAPACITY)
|
| 53 |
-
|
| 54 |
-
# Staff Workload (complex: depends on patients + severity)
|
| 55 |
-
severity_factor = 1 + 0.3 * df['flu_season_index'] + 0.2 * (df['hour'] >= 18).astype(int)
|
| 56 |
-
df['staff_workload'] = (
|
| 57 |
-
df['emergency_admissions'] * severity_factor *
|
| 58 |
-
(config.STAFF_PER_10_PATIENTS / 10)
|
| 59 |
-
).round().astype(int)
|
| 60 |
-
|
| 61 |
-
# Current bed occupancy
|
| 62 |
-
df['bed_occupancy'] = np.random.randint(30, 90, len(df))
|
| 63 |
-
|
| 64 |
-
# Add some random spikes (simulate outbreaks/accidents)
|
| 65 |
-
spike_indices = np.random.choice(len(df), size=int(len(df) * 0.02), replace=False)
|
| 66 |
-
df.loc[spike_indices, 'emergency_admissions'] *= np.random.uniform(1.5, 2.5, len(spike_indices))
|
| 67 |
-
df.loc[spike_indices, 'icu_demand'] *= np.random.uniform(1.3, 2.0, len(spike_indices))
|
| 68 |
-
|
| 69 |
-
# Round values
|
| 70 |
-
df['emergency_admissions'] = df['emergency_admissions'].round().astype(int)
|
| 71 |
-
df['icu_demand'] = df['icu_demand'].round().astype(int)
|
| 72 |
-
df['staff_workload'] = df['staff_workload'].round().astype(int)
|
| 73 |
-
|
| 74 |
-
return df
|
| 75 |
-
|
| 76 |
-
def add_lag_features(df, target_col, lags):
|
| 77 |
-
"""Add lag features for time series"""
|
| 78 |
-
for lag in lags:
|
| 79 |
-
df[f'{target_col}_lag_{lag}h'] = df[target_col].shift(lag)
|
| 80 |
-
return df
|
| 81 |
-
|
| 82 |
-
def add_rolling_features(df, target_col, windows):
|
| 83 |
-
"""Add rolling average features"""
|
| 84 |
-
for window in windows:
|
| 85 |
-
df[f'{target_col}_rolling_{window}h'] = df[target_col].rolling(window=window).mean()
|
| 86 |
-
return df
|
| 87 |
-
|
| 88 |
-
def prepare_ml_features(df):
|
| 89 |
-
"""Prepare features for ML models"""
|
| 90 |
-
|
| 91 |
-
# Add lag features for key targets
|
| 92 |
-
df = add_lag_features(df, 'emergency_admissions', config.LAG_FEATURES)
|
| 93 |
-
df = add_lag_features(df, 'icu_demand', config.LAG_FEATURES)
|
| 94 |
-
|
| 95 |
-
# Add rolling features
|
| 96 |
-
df = add_rolling_features(df, 'emergency_admissions', config.ROLLING_WINDOWS)
|
| 97 |
-
|
| 98 |
-
# Drop NaN rows created by lag features
|
| 99 |
-
df = df.dropna()
|
| 100 |
-
|
| 101 |
-
return df
|
| 102 |
-
|
| 103 |
-
if __name__ == "__main__":
|
| 104 |
-
# Generate and save data
|
| 105 |
-
print("Generating hospital data...")
|
| 106 |
-
df = generate_hospital_data(config.DAYS_OF_HISTORICAL_DATA)
|
| 107 |
-
|
| 108 |
-
print(f"Generated {len(df)} hourly records over {config.DAYS_OF_HISTORICAL_DATA} days")
|
| 109 |
-
print(f"\nData shape: {df.shape}")
|
| 110 |
-
print(f"\nSample data:")
|
| 111 |
-
print(df.head())
|
| 112 |
-
|
| 113 |
-
print(f"\nStatistics:")
|
| 114 |
-
print(df[['emergency_admissions', 'icu_demand', 'staff_workload']].describe())
|
| 115 |
-
|
| 116 |
-
# Save raw data
|
| 117 |
-
df.to_csv('hospital_data.csv', index=False)
|
| 118 |
-
print(f"\nData saved to hospital_data.csv")
|
| 119 |
-
|
| 120 |
-
# Prepare ML features
|
| 121 |
-
df_ml = prepare_ml_features(df.copy())
|
| 122 |
-
df_ml.to_csv('hospital_data_ml.csv', index=False)
|
| 123 |
-
print(f"ML-ready data saved to hospital_data_ml.csv")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/emergency_admissions_predictor.py
DELETED
|
@@ -1,147 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Emergency Admissions Predictor using Amazon Chronos
|
| 3 |
-
State-of-the-art pretrained time-series model
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import pandas as pd
|
| 7 |
-
import numpy as np
|
| 8 |
-
import torch
|
| 9 |
-
import config
|
| 10 |
-
from chronos import ChronosPipeline
|
| 11 |
-
import warnings
|
| 12 |
-
warnings.filterwarnings('ignore')
|
| 13 |
-
|
| 14 |
-
class EmergencyAdmissionsPredictor:
|
| 15 |
-
def __init__(self, model_name=config.CHRONOS_MODEL):
|
| 16 |
-
"""Initialize Chronos model for emergency admissions prediction"""
|
| 17 |
-
self.model_name = model_name
|
| 18 |
-
self.pipeline = None
|
| 19 |
-
|
| 20 |
-
def load_model(self):
|
| 21 |
-
"""Load pretrained Chronos model"""
|
| 22 |
-
print(f"Loading Chronos model: {self.model_name}...")
|
| 23 |
-
|
| 24 |
-
# Check if CUDA is available
|
| 25 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 26 |
-
dtype = torch.bfloat16 if device == "cuda" else torch.float32
|
| 27 |
-
|
| 28 |
-
self.pipeline = ChronosPipeline.from_pretrained(
|
| 29 |
-
self.model_name,
|
| 30 |
-
device_map=device,
|
| 31 |
-
torch_dtype=dtype,
|
| 32 |
-
)
|
| 33 |
-
print(f"Model loaded on {device}")
|
| 34 |
-
|
| 35 |
-
def predict(self, historical_data, prediction_length=48, num_samples=20):
|
| 36 |
-
"""
|
| 37 |
-
Predict future emergency admissions
|
| 38 |
-
|
| 39 |
-
Args:
|
| 40 |
-
historical_data: Array or list of historical admissions (hourly)
|
| 41 |
-
prediction_length: Hours to predict ahead
|
| 42 |
-
num_samples: Number of forecast samples for uncertainty
|
| 43 |
-
|
| 44 |
-
Returns:
|
| 45 |
-
Dictionary with predictions and confidence intervals
|
| 46 |
-
"""
|
| 47 |
-
if self.pipeline is None:
|
| 48 |
-
self.load_model()
|
| 49 |
-
|
| 50 |
-
# Convert to tensor
|
| 51 |
-
context = torch.tensor(historical_data, dtype=torch.float32)
|
| 52 |
-
|
| 53 |
-
# Generate forecast
|
| 54 |
-
forecast = self.pipeline.predict(
|
| 55 |
-
context=context,
|
| 56 |
-
prediction_length=prediction_length,
|
| 57 |
-
num_samples=num_samples,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
# Calculate statistics
|
| 61 |
-
forecast_np = forecast.squeeze().numpy()
|
| 62 |
-
|
| 63 |
-
predictions = {
|
| 64 |
-
'mean': forecast_np.mean(axis=0),
|
| 65 |
-
'median': np.median(forecast_np, axis=0),
|
| 66 |
-
'lower_bound': np.percentile(forecast_np, 10, axis=0),
|
| 67 |
-
'upper_bound': np.percentile(forecast_np, 90, axis=0),
|
| 68 |
-
'std': forecast_np.std(axis=0)
|
| 69 |
-
}
|
| 70 |
-
|
| 71 |
-
return predictions
|
| 72 |
-
|
| 73 |
-
def predict_from_dataframe(self, df, context_length=168, prediction_length=48):
|
| 74 |
-
"""
|
| 75 |
-
Predict from a pandas DataFrame
|
| 76 |
-
|
| 77 |
-
Args:
|
| 78 |
-
df: DataFrame with 'emergency_admissions' column
|
| 79 |
-
context_length: Hours of context to use (default: 1 week)
|
| 80 |
-
prediction_length: Hours to predict ahead
|
| 81 |
-
"""
|
| 82 |
-
# Get last context_length hours
|
| 83 |
-
historical_data = df['emergency_admissions'].tail(context_length).values
|
| 84 |
-
|
| 85 |
-
# Predict
|
| 86 |
-
predictions = self.predict(historical_data, prediction_length)
|
| 87 |
-
|
| 88 |
-
# Create future dates
|
| 89 |
-
last_date = df['datetime'].iloc[-1]
|
| 90 |
-
future_dates = pd.date_range(
|
| 91 |
-
start=last_date + pd.Timedelta(hours=1),
|
| 92 |
-
periods=prediction_length,
|
| 93 |
-
freq='H'
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
# Create prediction DataFrame
|
| 97 |
-
pred_df = pd.DataFrame({
|
| 98 |
-
'datetime': future_dates,
|
| 99 |
-
'predicted_admissions': predictions['mean'],
|
| 100 |
-
'predicted_admissions_lower': predictions['lower_bound'],
|
| 101 |
-
'predicted_admissions_upper': predictions['upper_bound'],
|
| 102 |
-
})
|
| 103 |
-
|
| 104 |
-
return pred_df, predictions
|
| 105 |
-
|
| 106 |
-
def demo():
|
| 107 |
-
"""Demo the emergency admissions predictor"""
|
| 108 |
-
print("=== Emergency Admissions Predictor Demo ===\n")
|
| 109 |
-
|
| 110 |
-
# Load data
|
| 111 |
-
print("Loading hospital data...")
|
| 112 |
-
df = pd.read_csv('hospital_data.csv')
|
| 113 |
-
df['datetime'] = pd.to_datetime(df['datetime'])
|
| 114 |
-
|
| 115 |
-
print(f"Data loaded: {len(df)} hours of data")
|
| 116 |
-
print(f"Latest admission count: {df['emergency_admissions'].iloc[-1]}")
|
| 117 |
-
print(f"Average admissions (last 7 days): {df['emergency_admissions'].tail(168).mean():.2f}\n")
|
| 118 |
-
|
| 119 |
-
# Initialize predictor
|
| 120 |
-
predictor = EmergencyAdmissionsPredictor()
|
| 121 |
-
|
| 122 |
-
# Make prediction
|
| 123 |
-
print(f"Predicting next {config.PREDICTION_HORIZON} hours...")
|
| 124 |
-
pred_df, predictions = predictor.predict_from_dataframe(
|
| 125 |
-
df,
|
| 126 |
-
context_length=168, # Use 1 week of context
|
| 127 |
-
prediction_length=config.PREDICTION_HORIZON
|
| 128 |
-
)
|
| 129 |
-
|
| 130 |
-
# Show results
|
| 131 |
-
print("\nPredictions for next 24 hours:")
|
| 132 |
-
print(pred_df.head(24))
|
| 133 |
-
|
| 134 |
-
# Summary statistics
|
| 135 |
-
print(f"\nSummary for next 48 hours:")
|
| 136 |
-
print(f"Expected total admissions: {predictions['mean'].sum():.0f}")
|
| 137 |
-
print(f"Peak hour prediction: {predictions['mean'].max():.0f} admissions")
|
| 138 |
-
print(f"Low hour prediction: {predictions['mean'].min():.0f} admissions")
|
| 139 |
-
|
| 140 |
-
# Save predictions
|
| 141 |
-
pred_df.to_csv('predictions_emergency_admissions.csv', index=False)
|
| 142 |
-
print("\nPredictions saved to predictions_emergency_admissions.csv")
|
| 143 |
-
|
| 144 |
-
return pred_df, predictions
|
| 145 |
-
|
| 146 |
-
if __name__ == "__main__":
|
| 147 |
-
demo()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/predict.py
DELETED
|
@@ -1,47 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Simple Command-Line Interface for Quick Predictions
|
| 3 |
-
"""
|
| 4 |
-
|
| 5 |
-
import sys
|
| 6 |
-
from predict_flexible import FlexiblePredictor
|
| 7 |
-
|
| 8 |
-
def main():
|
| 9 |
-
if len(sys.argv) < 2:
|
| 10 |
-
print("\nUsage: python predict.py <period>")
|
| 11 |
-
print("\nAvailable periods:")
|
| 12 |
-
print(" 24h - Next 24 hours")
|
| 13 |
-
print(" 48h - Next 48 hours (default)")
|
| 14 |
-
print(" weekend - Next weekend")
|
| 15 |
-
print(" week - Next week (7 days)")
|
| 16 |
-
print(" <number> - Custom hours (e.g., 72 for 3 days)")
|
| 17 |
-
print("\nExamples:")
|
| 18 |
-
print(" python predict.py 24h")
|
| 19 |
-
print(" python predict.py weekend")
|
| 20 |
-
print(" python predict.py 120 (5 days)")
|
| 21 |
-
return
|
| 22 |
-
|
| 23 |
-
period = sys.argv[1].lower()
|
| 24 |
-
|
| 25 |
-
predictor = FlexiblePredictor()
|
| 26 |
-
|
| 27 |
-
if period == '24h' or period == '24':
|
| 28 |
-
predictor.predict_next_24_hours()
|
| 29 |
-
elif period == '48h' or period == '48':
|
| 30 |
-
predictor.predict_next_48_hours()
|
| 31 |
-
elif period == 'weekend':
|
| 32 |
-
predictor.predict_next_weekend()
|
| 33 |
-
elif period == 'week' or period == '7d':
|
| 34 |
-
predictor.predict_next_week()
|
| 35 |
-
else:
|
| 36 |
-
try:
|
| 37 |
-
hours = int(period)
|
| 38 |
-
if hours > 0 and hours <= 720:
|
| 39 |
-
predictor.predict_custom(hours, f"Next {hours} Hours")
|
| 40 |
-
else:
|
| 41 |
-
print("Error: Hours must be between 1 and 720")
|
| 42 |
-
except ValueError:
|
| 43 |
-
print(f"Error: Unknown period '{period}'")
|
| 44 |
-
print("Use: 24h, 48h, weekend, week, or a number")
|
| 45 |
-
|
| 46 |
-
if __name__ == "__main__":
|
| 47 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/visualize.py
DELETED
|
@@ -1,219 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Visualization Dashboard for Hospital Prediction System
|
| 3 |
-
Creates impressive charts for hackathon presentation
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import pandas as pd
|
| 7 |
-
import matplotlib.pyplot as plt
|
| 8 |
-
import seaborn as sns
|
| 9 |
-
import numpy as np
|
| 10 |
-
from datetime import datetime
|
| 11 |
-
import warnings
|
| 12 |
-
warnings.filterwarnings('ignore')
|
| 13 |
-
|
| 14 |
-
sns.set_style("whitegrid")
|
| 15 |
-
plt.rcParams['figure.figsize'] = (15, 10)
|
| 16 |
-
|
| 17 |
-
def create_dashboard():
|
| 18 |
-
"""Create comprehensive visualization dashboard"""
|
| 19 |
-
|
| 20 |
-
# Load data
|
| 21 |
-
print("Loading data...")
|
| 22 |
-
historical = pd.read_csv('hospital_data.csv')
|
| 23 |
-
predictions = pd.read_csv('predictions_final.csv')
|
| 24 |
-
|
| 25 |
-
historical['datetime'] = pd.to_datetime(historical['datetime'])
|
| 26 |
-
predictions['datetime'] = pd.to_datetime(predictions['datetime'])
|
| 27 |
-
|
| 28 |
-
# Create figure with subplots
|
| 29 |
-
fig = plt.figure(figsize=(16, 12))
|
| 30 |
-
|
| 31 |
-
# 1. Emergency Admissions - Historical + Predictions
|
| 32 |
-
ax1 = plt.subplot(3, 2, 1)
|
| 33 |
-
last_week = historical.tail(168) # Last 7 days
|
| 34 |
-
ax1.plot(last_week['datetime'], last_week['emergency_admissions'],
|
| 35 |
-
label='Historical', color='#2E86AB', linewidth=2)
|
| 36 |
-
ax1.plot(predictions['datetime'], predictions['predicted_emergency_admissions'],
|
| 37 |
-
label='Predicted', color='#F24236', linewidth=2, linestyle='--')
|
| 38 |
-
ax1.set_title('Emergency Admissions: Historical vs Predicted', fontsize=14, fontweight='bold')
|
| 39 |
-
ax1.set_xlabel('Time')
|
| 40 |
-
ax1.set_ylabel('Admissions per Hour')
|
| 41 |
-
ax1.legend()
|
| 42 |
-
ax1.grid(True, alpha=0.3)
|
| 43 |
-
|
| 44 |
-
# 2. ICU Demand Forecast
|
| 45 |
-
ax2 = plt.subplot(3, 2, 2)
|
| 46 |
-
ax2.plot(predictions['datetime'], predictions['predicted_icu_demand'],
|
| 47 |
-
color='#A23B72', linewidth=2.5, marker='o', markersize=3)
|
| 48 |
-
ax2.axhline(y=20, color='red', linestyle='--', label='ICU Capacity', linewidth=2)
|
| 49 |
-
ax2.fill_between(predictions['datetime'], 0, predictions['predicted_icu_demand'],
|
| 50 |
-
alpha=0.3, color='#A23B72')
|
| 51 |
-
ax2.set_title('ICU Demand Forecast (48 Hours)', fontsize=14, fontweight='bold')
|
| 52 |
-
ax2.set_xlabel('Time')
|
| 53 |
-
ax2.set_ylabel('ICU Beds Needed')
|
| 54 |
-
ax2.legend()
|
| 55 |
-
ax2.grid(True, alpha=0.3)
|
| 56 |
-
|
| 57 |
-
# 3. Staff Workload Prediction
|
| 58 |
-
ax3 = plt.subplot(3, 2, 3)
|
| 59 |
-
ax3.plot(predictions['datetime'], predictions['predicted_staff_workload'],
|
| 60 |
-
color='#F18F01', linewidth=2.5, marker='s', markersize=3)
|
| 61 |
-
ax3.fill_between(predictions['datetime'], 0, predictions['predicted_staff_workload'],
|
| 62 |
-
alpha=0.3, color='#F18F01')
|
| 63 |
-
ax3.set_title('Staff Workload Forecast', fontsize=14, fontweight='bold')
|
| 64 |
-
ax3.set_xlabel('Time')
|
| 65 |
-
ax3.set_ylabel('Staff Required')
|
| 66 |
-
ax3.grid(True, alpha=0.3)
|
| 67 |
-
|
| 68 |
-
# 4. Seasonal Pattern Analysis
|
| 69 |
-
ax4 = plt.subplot(3, 2, 4)
|
| 70 |
-
monthly_avg = historical.groupby('month')['emergency_admissions'].mean()
|
| 71 |
-
months_available = monthly_avg.index.tolist()
|
| 72 |
-
month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
| 73 |
-
labels = [month_names[m-1] for m in months_available]
|
| 74 |
-
bars = ax4.bar(months_available, monthly_avg, color=sns.color_palette("coolwarm", len(months_available)))
|
| 75 |
-
ax4.set_title('Seasonal Admission Pattern', fontsize=14, fontweight='bold')
|
| 76 |
-
ax4.set_xlabel('Month')
|
| 77 |
-
ax4.set_ylabel('Avg Hourly Admissions')
|
| 78 |
-
ax4.set_xticks(months_available)
|
| 79 |
-
ax4.set_xticklabels(labels)
|
| 80 |
-
ax4.grid(True, alpha=0.3, axis='y')
|
| 81 |
-
|
| 82 |
-
# 5. Hourly Pattern (Heatmap style)
|
| 83 |
-
ax5 = plt.subplot(3, 2, 5)
|
| 84 |
-
hourly_avg = historical.groupby('hour')['emergency_admissions'].mean()
|
| 85 |
-
ax5.bar(range(24), hourly_avg, color='#06A77D', alpha=0.7)
|
| 86 |
-
ax5.set_title('Daily Pattern: Peak Hours', fontsize=14, fontweight='bold')
|
| 87 |
-
ax5.set_xlabel('Hour of Day')
|
| 88 |
-
ax5.set_ylabel('Avg Admissions')
|
| 89 |
-
ax5.set_xticks(range(0, 24, 3))
|
| 90 |
-
ax5.grid(True, alpha=0.3, axis='y')
|
| 91 |
-
|
| 92 |
-
# 6. External Factors Impact
|
| 93 |
-
ax6 = plt.subplot(3, 2, 6)
|
| 94 |
-
last_days = historical.tail(168)
|
| 95 |
-
ax6_twin = ax6.twinx()
|
| 96 |
-
|
| 97 |
-
ax6.plot(last_days['datetime'], last_days['emergency_admissions'],
|
| 98 |
-
label='Admissions', color='#2E86AB', linewidth=2)
|
| 99 |
-
ax6_twin.plot(last_days['datetime'], last_days['flu_season_index'],
|
| 100 |
-
label='Flu Season Index', color='#E63946', linewidth=2, alpha=0.7)
|
| 101 |
-
|
| 102 |
-
ax6.set_title('External Factors: Flu Season Impact', fontsize=14, fontweight='bold')
|
| 103 |
-
ax6.set_xlabel('Time')
|
| 104 |
-
ax6.set_ylabel('Admissions', color='#2E86AB')
|
| 105 |
-
ax6_twin.set_ylabel('Flu Index', color='#E63946')
|
| 106 |
-
ax6.legend(loc='upper left')
|
| 107 |
-
ax6_twin.legend(loc='upper right')
|
| 108 |
-
ax6.grid(True, alpha=0.3)
|
| 109 |
-
|
| 110 |
-
plt.tight_layout()
|
| 111 |
-
plt.savefig('hospital_dashboard.png', dpi=300, bbox_inches='tight')
|
| 112 |
-
print("✓ Dashboard saved as hospital_dashboard.png")
|
| 113 |
-
|
| 114 |
-
# Create summary metrics visualization
|
| 115 |
-
create_metrics_summary(predictions)
|
| 116 |
-
|
| 117 |
-
plt.show()
|
| 118 |
-
|
| 119 |
-
def create_metrics_summary(predictions):
|
| 120 |
-
"""Create a clean metrics summary chart"""
|
| 121 |
-
|
| 122 |
-
fig, axes = plt.subplots(2, 2, figsize=(12, 8))
|
| 123 |
-
fig.suptitle('Hospital Emergency Metrics - Next 48 Hours',
|
| 124 |
-
fontsize=16, fontweight='bold', y=0.98)
|
| 125 |
-
|
| 126 |
-
# 1. Total Expected Admissions
|
| 127 |
-
ax1 = axes[0, 0]
|
| 128 |
-
total_admissions = int(predictions['predicted_emergency_admissions'].sum())
|
| 129 |
-
ax1.text(0.5, 0.5, str(total_admissions),
|
| 130 |
-
ha='center', va='center', fontsize=60, fontweight='bold', color='#2E86AB')
|
| 131 |
-
ax1.text(0.5, 0.2, 'Expected Admissions',
|
| 132 |
-
ha='center', va='center', fontsize=14, color='gray')
|
| 133 |
-
ax1.axis('off')
|
| 134 |
-
ax1.set_facecolor('#F0F0F0')
|
| 135 |
-
|
| 136 |
-
# 2. Peak ICU Demand
|
| 137 |
-
ax2 = axes[0, 1]
|
| 138 |
-
peak_icu = predictions['predicted_icu_demand'].max()
|
| 139 |
-
ax2.text(0.5, 0.5, f'{peak_icu:.1f}',
|
| 140 |
-
ha='center', va='center', fontsize=60, fontweight='bold', color='#A23B72')
|
| 141 |
-
ax2.text(0.5, 0.2, 'Peak ICU Beds',
|
| 142 |
-
ha='center', va='center', fontsize=14, color='gray')
|
| 143 |
-
ax2.axis('off')
|
| 144 |
-
ax2.set_facecolor('#F0F0F0')
|
| 145 |
-
|
| 146 |
-
# 3. Status Indicator
|
| 147 |
-
ax3 = axes[1, 0]
|
| 148 |
-
status = 'NORMAL'
|
| 149 |
-
status_color = '#06A77D'
|
| 150 |
-
if peak_icu > 17:
|
| 151 |
-
status = 'CRITICAL'
|
| 152 |
-
status_color = '#E63946'
|
| 153 |
-
elif peak_icu > 14:
|
| 154 |
-
status = 'ELEVATED'
|
| 155 |
-
status_color = '#F18F01'
|
| 156 |
-
|
| 157 |
-
ax3.text(0.5, 0.5, status,
|
| 158 |
-
ha='center', va='center', fontsize=48, fontweight='bold', color=status_color)
|
| 159 |
-
ax3.text(0.5, 0.2, 'Hospital Status',
|
| 160 |
-
ha='center', va='center', fontsize=14, color='gray')
|
| 161 |
-
ax3.axis('off')
|
| 162 |
-
ax3.set_facecolor('#F0F0F0')
|
| 163 |
-
|
| 164 |
-
# 4. Peak Staff Required
|
| 165 |
-
ax4 = axes[1, 1]
|
| 166 |
-
peak_staff = int(np.ceil(predictions['predicted_staff_workload'].max()))
|
| 167 |
-
ax4.text(0.5, 0.5, str(peak_staff),
|
| 168 |
-
ha='center', va='center', fontsize=60, fontweight='bold', color='#F18F01')
|
| 169 |
-
ax4.text(0.5, 0.2, 'Peak Staff Required',
|
| 170 |
-
ha='center', va='center', fontsize=14, color='gray')
|
| 171 |
-
ax4.axis('off')
|
| 172 |
-
ax4.set_facecolor('#F0F0F0')
|
| 173 |
-
|
| 174 |
-
plt.tight_layout()
|
| 175 |
-
plt.savefig('hospital_metrics.png', dpi=300, bbox_inches='tight')
|
| 176 |
-
print("✓ Metrics summary saved as hospital_metrics.png")
|
| 177 |
-
|
| 178 |
-
def create_comparison_chart():
|
| 179 |
-
"""Create model comparison chart"""
|
| 180 |
-
|
| 181 |
-
fig, ax = plt.subplots(figsize=(10, 6))
|
| 182 |
-
|
| 183 |
-
models = ['Chronos\n(Transformer)', 'XGBoost\nICU', 'XGBoost\nStaff']
|
| 184 |
-
accuracy = [92, 67, 58] # Approximate R² scores as percentage
|
| 185 |
-
speed = [3, 0.1, 0.1] # Training time in seconds
|
| 186 |
-
|
| 187 |
-
x = np.arange(len(models))
|
| 188 |
-
width = 0.35
|
| 189 |
-
|
| 190 |
-
ax.bar(x - width/2, accuracy, width, label='Accuracy (%)', color='#2E86AB')
|
| 191 |
-
ax2 = ax.twinx()
|
| 192 |
-
ax2.bar(x + width/2, speed, width, label='Train Time (s)', color='#F18F01')
|
| 193 |
-
|
| 194 |
-
ax.set_xlabel('Model', fontsize=12)
|
| 195 |
-
ax.set_ylabel('Accuracy (%)', color='#2E86AB', fontsize=12)
|
| 196 |
-
ax2.set_ylabel('Training Time (seconds)', color='#F18F01', fontsize=12)
|
| 197 |
-
ax.set_title('Model Performance Comparison', fontsize=14, fontweight='bold')
|
| 198 |
-
ax.set_xticks(x)
|
| 199 |
-
ax.set_xticklabels(models)
|
| 200 |
-
ax.legend(loc='upper left')
|
| 201 |
-
ax2.legend(loc='upper right')
|
| 202 |
-
ax.grid(True, alpha=0.3, axis='y')
|
| 203 |
-
|
| 204 |
-
plt.tight_layout()
|
| 205 |
-
plt.savefig('model_comparison.png', dpi=300, bbox_inches='tight')
|
| 206 |
-
print("✓ Model comparison saved as model_comparison.png")
|
| 207 |
-
|
| 208 |
-
if __name__ == "__main__":
|
| 209 |
-
print("=== Creating Hospital Prediction Dashboard ===\n")
|
| 210 |
-
|
| 211 |
-
create_dashboard()
|
| 212 |
-
create_comparison_chart()
|
| 213 |
-
|
| 214 |
-
print("\n✓ All visualizations created!")
|
| 215 |
-
print("\nGenerated files:")
|
| 216 |
-
print(" • hospital_dashboard.png - Main analytics dashboard")
|
| 217 |
-
print(" • hospital_metrics.png - Key metrics summary")
|
| 218 |
-
print(" • model_comparison.png - Model performance comparison")
|
| 219 |
-
print("\nUse these in your hackathon presentation!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|