Newer
Older
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
"L 349.84461 272.865651 \n",
"L 350.025234 273.417872 \n",
"L 350.386483 276.894754 \n",
"L 350.747731 283.534887 \n",
"L 351.289604 299.42194 \n",
"L 351.831477 313.173864 \n",
"L 352.192725 316.441798 \n",
"L 352.373349 316.305761 \n",
"L 352.553974 314.98972 \n",
"L 352.915222 308.94178 \n",
"L 353.457095 294.998592 \n",
"L 354.179592 269.07731 \n",
"L 354.54084 255.724071 \n",
"L 354.902089 249.657877 \n",
"L 355.082713 249.401303 \n",
"L 355.263337 250.819358 \n",
"L 355.624586 258.892896 \n",
"L 356.888955 301.835358 \n",
"L 357.250204 309.43237 \n",
"L 357.430828 310.593653 \n",
"L 357.611452 309.745359 \n",
"L 357.792077 306.887486 \n",
"L 358.153325 295.14301 \n",
"L 358.514574 282.047536 \n",
"L 358.875822 275.729251 \n",
"L 359.056446 275.117777 \n",
"L 359.237071 276.038833 \n",
"L 359.598319 282.108098 \n",
"L 360.682065 310.85936 \n",
"L 361.043313 315.431016 \n",
"L 361.404561 317.339337 \n",
"L 361.585186 317.55443 \n",
"L 361.76581 317.311088 \n",
"L 361.946434 316.609312 \n",
"L 362.307683 313.830453 \n",
"L 363.391428 302.419985 \n",
"L 363.572052 302.714163 \n",
"L 363.752677 304.192435 \n",
"L 364.113925 310.792044 \n",
"L 364.836422 332.069863 \n",
"L 365.920168 364.950516 \n",
"L 366.100792 366.315147 \n",
"L 366.281416 366.051201 \n",
"L 366.46204 364.158678 \n",
"L 367.545786 344.005319 \n",
"L 367.907034 342.053011 \n",
"L 368.087658 342.089626 \n",
"L 368.268283 342.286142 \n",
"L 368.448907 342.280512 \n",
"L 368.629531 342.072735 \n",
"L 368.99078 341.050741 \n",
"L 369.352028 339.220161 \n",
"L 369.713277 336.862593 \n",
"L 369.893901 336.372625 \n",
"L 370.074525 336.548126 \n",
"L 370.255149 337.389097 \n",
"L 370.616398 341.067446 \n",
"L 370.977646 347.407672 \n",
"L 371.519519 358.238365 \n",
"L 371.700143 359.847144 \n",
"L 371.880768 360.313005 \n",
"L 372.061392 360.084753 \n",
"L 372.242016 359.409412 \n",
"L 372.603265 356.7344 \n",
"L 372.964513 354.311039 \n",
"L 373.145137 353.715682 \n",
"L 373.325762 353.531206 \n",
"L 373.506386 353.757612 \n",
"L 373.68701 354.3949 \n",
"L 374.048259 356.902121 \n",
"L 374.590131 361.753801 \n",
"L 374.95138 363.280773 \n",
"L 375.132004 363.488985 \n",
"L 375.493252 363.496633 \n",
"L 375.854501 363.127717 \n",
"L 376.035125 363.957965 \n",
"L 376.396374 369.123258 \n",
"L 376.938246 381.146181 \n",
"L 377.118871 382.568478 \n",
"L 377.299495 382.355572 \n",
"L 377.480119 380.507464 \n",
"L 377.841368 371.905642 \n",
"L 378.744489 341.274679 \n",
"L 378.925113 339.337448 \n",
"L 379.105737 339.065424 \n",
"L 379.286362 340.458607 \n",
"L 379.64761 348.240595 \n",
"L 380.008859 357.705929 \n",
"L 380.370107 361.253881 \n",
"L 380.550731 361.081337 \n",
"L 380.731356 360.086525 \n",
"L 381.092604 355.579637 \n",
"L 381.634477 347.204942 \n",
"L 381.995725 344.350356 \n",
"L 382.176349 343.765812 \n",
"L 382.356974 343.743102 \n",
"L 382.537598 344.290089 \n",
"L 382.898846 347.185942 \n",
"L 383.260095 352.492091 \n",
"L 384.34384 373.541004 \n",
"L 384.705089 376.037308 \n",
"L 384.885713 376.239359 \n",
"L 385.066337 375.744009 \n",
"L 385.788834 371.295377 \n",
"L 386.691956 364.219949 \n",
"L 388.317574 350.691571 \n",
"L 388.678822 348.532046 \n",
"L 389.040071 347.767073 \n",
"L 389.220695 347.815229 \n",
"L 389.401319 348.012106 \n",
"L 389.581943 348.374825 \n",
"L 389.943192 350.393954 \n",
"L 390.30444 354.35 \n",
"L 390.846313 363.909534 \n",
"L 391.207562 370.069189 \n",
"L 391.56881 373.377923 \n",
"L 391.749434 373.963195 \n",
"L 391.930059 373.835737 \n",
"L 392.110683 372.995549 \n",
"L 392.652556 368.685378 \n",
"L 392.83318 368.112256 \n",
"L 393.013804 368.076142 \n",
"L 393.194428 368.543366 \n",
"L 393.375053 368.286544 \n",
"L 393.555677 366.68856 \n",
"L 393.916925 359.489652 \n",
"L 394.278174 351.973803 \n",
"L 394.639422 348.018721 \n",
"L 394.820046 347.376468 \n",
"L 395.000671 347.624407 \n",
"L 395.181295 348.762539 \n",
"L 395.723168 353.268042 \n",
"L 395.903792 353.796116 \n",
"L 396.084416 353.80214 \n",
"L 396.26504 353.286113 \n",
"L 396.626289 350.68791 \n",
"L 397.168162 345.5532 \n",
"L 397.348786 344.842683 \n",
"L 397.52941 344.685613 \n",
"L 397.710034 344.847689 \n",
"L 397.890659 345.200994 \n",
"L 398.071283 348.471936 \n",
"L 398.974404 380.785182 \n",
"L 399.155028 382.864383 \n",
"L 399.335653 383.201742 \n",
"L 399.516277 381.838618 \n",
"L 399.877525 376.583997 \n",
"L 400.419398 363.811033 \n",
"L 401.141895 344.026078 \n",
"L 401.322519 343.895232 \n",
"L 401.503143 346.346924 \n",
"L 401.864392 358.997916 \n",
"L 402.586889 396.00057 \n",
"L 402.948137 401.853596 \n",
"L 403.128762 401.150496 \n",
"L 403.309386 398.027655 \n",
"L 403.670634 384.522749 \n",
"L 404.031883 369.587435 \n",
"L 404.393131 362.601501 \n",
"L 404.573756 362.093126 \n",
"L 404.75438 363.57448 \n",
"L 405.115628 372.506374 \n",
"L 405.476877 383.32317 \n",
"L 405.657501 384.100111 \n",
"L 405.838125 381.583433 \n",
"L 406.199374 366.669215 \n",
"L 406.921871 319.75457 \n",
"L 407.102495 316.18287 \n",
"L 407.283119 315.805082 \n",
"L 407.463744 315.070616 \n",
"L 407.824992 311.529967 \n",
"L 408.366865 304.112579 \n",
"L 408.547489 303.772089 \n",
"L 408.728113 304.763943 \n",
"L 409.089362 310.744681 \n",
"L 410.173107 338.361342 \n",
"L 410.71498 341.245795 \n",
"L 411.076228 343.117875 \n",
"L 411.437477 346.32967 \n",
"L 411.97935 354.018838 \n",
"L 412.340598 357.921177 \n",
"L 412.521222 358.242346 \n",
"L 412.701847 357.476847 \n",
"L 413.063095 352.685846 \n",
"L 413.424344 343.548176 \n",
"L 414.146841 322.307148 \n",
"L 414.327465 320.296058 \n",
"L 414.508089 319.779557 \n",
"L 414.688713 320.278745 \n",
"L 415.049962 323.680685 \n",
"L 415.41121 327.039868 \n",
"L 415.772459 328.620508 \n",
"L 415.953083 328.743873 \n",
"L 416.133707 328.422602 \n",
"L 416.494956 326.946345 \n",
"L 416.67558 327.175462 \n",
"L 416.856204 328.360869 \n",
"L 417.217453 333.600549 \n",
"L 417.578701 342.665385 \n",
"L 418.301198 363.897444 \n",
"L 418.662447 368.577532 \n",
"L 418.843071 369.264059 \n",
"L 419.023695 368.848241 \n",
"L 419.565568 363.58746 \n",
"L 421.010562 349.581226 \n",
"L 421.37181 347.908781 \n",
"L 421.552434 347.708096 \n",
"L 421.733059 347.931103 \n",
"L 421.913683 348.577802 \n",
"L 422.455556 351.869345 \n",
"L 422.63618 351.677605 \n",
"L 422.816804 350.503224 \n",
"L 423.178053 345.206543 \n",
"L 423.90055 330.30778 \n",
"L 424.261798 328.956788 \n",
"L 424.442422 327.110911 \n",
"L 424.803671 319.224747 \n",
"L 425.164919 311.481121 \n",
"L 425.345544 310.034948 \n",
"L 425.526168 310.207124 \n",
"L 425.706792 311.99765 \n",
"L 426.068041 320.433751 \n",
"L 426.790538 344.732528 \n",
"L 427.33241 356.166759 \n",
"L 427.693659 360.341166 \n",
"L 428.054907 362.155187 \n",
"L 428.235531 362.216124 \n",
"L 428.416156 361.713011 \n",
"L 428.777404 359.014638 \n",
"L 430.041774 344.92037 \n",
"L 430.222398 344.502734 \n",
"L 430.403022 344.555246 \n",
"L 430.583647 345.077905 \n",
"L 431.306144 348.535025 \n",
"L 431.667392 349.04955 \n",
"L 431.848016 350.336831 \n",
"L 433.112386 365.249262 \n",
"L 433.29301 365.857089 \n",
"L 433.473635 366.023683 \n",
"L 433.654259 365.509563 \n",
"L 434.015507 362.056224 \n",
"L 434.376756 355.36942 \n",
"L 435.099253 337.252593 \n",
"L 435.279877 336.129689 \n",
"L 435.460501 336.996836 \n",
"L 435.641125 339.854033 \n",
"L 436.182998 356.715741 \n",
"L 437.086119 389.187545 \n",
"L 437.266744 391.863362 \n",
"L 437.447368 392.522561 \n",
"L 437.627992 391.165143 \n",
"L 437.989241 382.772977 \n",
"L 438.711738 358.017141 \n",
"L 439.434235 331.518856 \n",
"L 439.614859 329.532243 \n",
"L 439.795483 329.579111 \n",
"L 439.976107 330.465166 \n",
"L 440.337356 334.609478 \n",
"L 440.879229 346.098931 \n",
"L 441.421101 355.156693 \n",
"L 441.78235 358.28706 \n",
"L 441.962974 358.979801 \n",
"L 442.143598 359.093261 \n",
"L 442.324222 358.705964 \n",
"L 442.685471 356.543917 \n",
"L 443.046719 352.531933 \n",
"L 443.407968 348.490999 \n",
"L 443.588592 349.406784 \n",
"L 443.769216 352.610786 \n",
"L 444.130465 365.883442 \n",
"L 444.491713 388.308969 \n",
"L 445.033586 426.463136 \n",
"L 445.394835 435.288416 \n",
"L 445.575459 435.399003 \n",
"L 445.936707 436.326134 \n",
"L 446.117332 435.163224 \n",
"L 446.47858 427.6617 \n",
"L 446.839829 412.94056 \n",
"L 447.381701 375.672763 \n",
"L 447.923574 330.241491 \n",
"L 448.104198 324.089827 \n",
"L 448.465447 321.984376 \n",
"L 448.826695 318.838138 \n",
"L 449.007319 319.797397 \n",
"L 449.187944 315.014721 \n",
"L 449.368568 314.63237 \n",
"L 449.729816 310.109114 \n",
"L 449.910441 326.224024 \n",
"L 450.091065 318.613805 \n",
"L 450.271689 326.75577 \n",
"L 450.452313 329.039164 \n",
"L 450.813562 323.441173 \n",
"L 450.994186 323.303504 \n",
"L 451.17481 325.309341 \n",
"L 451.897307 340.07372 \n",
"L 452.077932 340.791761 \n",
"L 452.43918 339.42012 \n",
"L 452.619804 340.948434 \n",
"L 452.981053 350.682368 \n",
"L 453.70355 382.167106 \n",
"L 453.884174 385.134642 \n",
"L 454.064798 385.605521 \n",
"L 454.245423 383.579743 \n",
"L 454.606671 372.038217 \n",
"L 455.148544 347.414684 \n",
"L 455.509792 341.860498 \n",
"L 455.690416 342.689029 \n",
"L 455.871041 345.92131 \n",
"L 456.954786 376.423664 \n",
"L 457.13541 376.52424 \n",
"L 457.316035 374.950705 \n",
"L 457.677283 367.096207 \n",
"L 458.038532 360.236774 \n",
"L 458.39978 357.478249 \n",
"L 458.580404 357.460045 \n",
"L 458.761029 357.745222 \n",
"L 459.483526 359.623337 \n",
"L 459.66415 359.253571 \n",
"L 460.025398 357.225285 \n",
"L 460.567271 351.999229 \n",
"L 460.747895 351.960509 \n",
"L 460.92852 353.365129 \n",
"L 461.289768 360.50439 \n",
"L 461.651017 373.417012 \n",
"L 462.192889 393.750031 \n",
"L 462.554138 399.387947 \n",
"L 462.734762 399.764996 \n",
"L 462.915386 398.514105 \n",
"L 464.179756 379.005069 \n",
"L 464.541004 376.265804 \n",
"L 464.902253 374.843825 \n",
"L 465.263501 374.076955 \n",
"L 465.62475 373.825582 \n",
"L 465.985998 375.360622 \n",
"L 466.166623 372.482496 \n",
"L 466.527871 362.116163 \n",
"L 466.708495 360.562145 \n",
"L 466.88912 361.918332 \n",
"L 467.069744 366.184722 \n",
"L 467.430992 383.448116 \n",
"L 467.792241 402.495683 \n",
"L 468.153489 410.366872 \n",
"L 468.334114 410.089277 \n",
"L 468.514738 407.002888 \n",
"L 468.875986 396.882305 \n",
"L 469.05661 395.538386 \n",
"L 469.417859 396.965667 \n",
"L 469.598483 396.621252 \n",
"L 469.779107 395.110822 \n",
"L 470.140356 388.655762 \n",
"L 470.682229 380.095344 \n",
"L 471.043477 377.992294 \n",
"L 471.224101 378.021937 \n",
"L 471.404726 378.772359 \n",
"L 472.84972 389.91885 \n",
"L 473.210968 390.983999 \n",
"L 473.752841 392.207706 \n",
"L 474.114089 392.982987 \n",
"L 474.294714 390.658716 \n",
"L 474.655962 376.640575 \n",
"L 475.017211 357.867015 \n",
"L 475.197835 353.500062 \n",
"L 475.378459 352.632465 \n",
"L 475.559083 353.817132 \n",
"L 475.920332 361.094573 \n",
"L 476.28158 370.369138 \n",
"L 476.462204 371.214797 \n",
"L 476.642829 369.301788 \n",
"L 477.004077 357.199769 \n",
"L 477.365326 334.063081 \n",
"L 477.726574 308.924618 \n",
"L 477.907198 303.831546 \n",
"L 478.087823 304.06681 \n",
"L 478.268447 309.630411 \n",
"L 478.629695 336.742622 \n",
"L 478.990944 368.434478 \n",
"L 479.352192 385.293706 \n",
"L 479.532817 388.151232 \n",
"L 479.713441 387.294032 \n",
"L 479.894065 382.722107 \n",
"L 480.797186 344.062568 \n",
"L 481.158435 338.890972 \n",
"L 481.339059 338.816552 \n",
"L 481.519683 340.416386 \n",
"L 481.880932 348.638809 \n",
"L 482.24218 357.530396 \n",
"L 482.422804 359.459835 \n",
"L 482.603429 359.705507 \n",
"L 482.784053 358.26741 \n",
"L 483.145301 350.339913 \n",
"L 483.50655 339.893376 \n",
"L 483.867798 335.553974 \n",
"L 484.048423 335.77039 \n",
"L 484.229047 337.577549 \n",
"L 485.674041 363.595444 \n",
"L 486.577162 372.264025 \n",
"L 487.119035 380.457391 \n",
"L 487.660908 389.182187 \n",
"L 488.022156 392.056489 \n",
"L 488.20278 392.533149 \n",
"L 488.383405 392.369481 \n",
"L 488.564029 391.565485 \n",
"L 488.925277 387.88316 \n",
"L 489.286526 381.064706 \n",
"L 489.828398 364.911331 \n",
"L 490.73152 334.008507 \n",
"L 491.092768 329.245668 \n",
"L 491.273392 328.708007 \n",
"L 491.454017 329.399519 \n",
"L 491.995889 334.161556 \n",
"L 492.357138 335.215072 \n",
"L 492.537762 334.56187 \n",
"L 492.718386 331.753649 \n",
"L 493.079635 319.512463 \n",
"L 493.440883 303.775638 \n",
"L 493.621508 300.527406 \n",
"L 493.802132 300.72947 \n",
"L 493.982756 304.38183 \n",
"L 494.344005 322.037439 \n",
"L 494.705253 346.508373 \n",
"L 495.066502 357.904429 \n",
"L 495.247126 358.241434 \n",
"L 495.42775 355.004423 \n",
"L 495.42775 355.004423 \n",
"\" style=\"fill:none;stroke:#ff7f0e;stroke-dasharray:2.775,1.2;stroke-dashoffset:0;stroke-width:0.75;\"/>\n",
" </g>\n",
" <g id=\"patch_20\">\n",
" <path d=\"M 283.972321 445.879219 \n",
"L 283.972321 238.793504 \n",
"\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
" </g>\n",
" <g id=\"patch_21\">\n",
" <path d=\"M 496.54375 445.879219 \n",
"L 496.54375 238.793504 \n",
"\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
" </g>\n",
" <g id=\"patch_22\">\n",
" <path d=\"M 283.972321 445.879219 \n",
"L 496.54375 445.879219 \n",
"\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
" </g>\n",
" <g id=\"patch_23\">\n",
" <path d=\"M 283.972321 238.793504 \n",
"L 496.54375 238.793504 \n",
"\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
" </g>\n",
" </g>\n",
" </g>\n",
" <defs>\n",
" <clipPath id=\"pc0135a8cf9\">\n",
" <rect height=\"207.085714\" width=\"212.571429\" x=\"50.14375\" y=\"10.999219\"/>\n",
" </clipPath>\n",
" <clipPath id=\"p014be86e20\">\n",
" <rect height=\"207.085714\" width=\"212.571429\" x=\"283.972321\" y=\"10.999219\"/>\n",
" </clipPath>\n",
" <clipPath id=\"p02bccc03e0\">\n",
" <rect height=\"207.085714\" width=\"212.571429\" x=\"50.14375\" y=\"238.793504\"/>\n",
" </clipPath>\n",
" <clipPath id=\"p3330aa6a0f\">\n",
" <rect height=\"207.085714\" width=\"212.571429\" x=\"283.972321\" y=\"238.793504\"/>\n",
" </clipPath>\n",
" </defs>\n",
"</svg>\n"
],
"text/plain": [
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
"fig, axes = plt.subplots(2, 2, figsize=(8,8), sharex=True, gridspec_kw={'hspace': 0.1, 'wspace': 0.1})\n",
"\n",
"plt.sca(axes[0,0])\n",
"ts_plot = ts_imax[(ts_imax['t'] >= -10) & (ts_imax['t'] < 15)][['t', 'Temp']].dropna()\n",
"ts_plot = ts_plot.set_index('t')\n",
"ts_plot['Temp_MA'] = np.nan\n",
"wsize = 0.1\n",
"for t in ts_plot.index:\n",
" ts_plot.loc[t, 'Temp_MA'] = np.mean(ts_plot.loc[\n",
" (t-wsize < ts_plot.index) & (ts_plot.index < t+wsize), 'Temp'\n",
" ])\n",
"ts_plot = ts_plot.reset_index()\n",
"x = ts_plot['t']\n",
"y = ts_plot['Temp_MA']\n",
"x_new = np.linspace(x.min(), x.max(), 1000)\n",
"f = interp1d(x, y, kind='quadratic')\n",
"y_smooth = f(x_new)\n",
"plt.plot(x_new, y_smooth, '--', lw=0.75, label=' positive example\\npredicted risk: {:.3f}'.format(y_prob[imax]))\n",
"# plt.plot(ts_plot['t'], ts_plot['Temp_MA'], '-', lw=1, label='positive example')\n",
"plt.scatter(ts_plot['t'], ts_plot['Temp_MA'], s=5)\n",
"\n",
"plt.xlim(-10, 15)\n",
"plt.ylim(36, 39)\n",
"# plt.xlabel('Days relative to transplant')\n",
"plt.ylabel('Temperature (Celsius)')\n",
"plt.legend()\n",
"\n",
"plt.sca(axes[0,1])\n",
"ts_plot = ts_imin[(ts_imin['t'] >= -10) & (ts_imin['t'] < 15)][['t', 'Temp']].dropna()\n",
"ts_plot = ts_plot.set_index('t')\n",
"ts_plot['Temp_MA'] = np.nan\n",
"wsize = 0.1\n",
"for t in ts_plot.index:\n",
" ts_plot.loc[t, 'Temp_MA'] = np.mean(ts_plot.loc[\n",
" (t-wsize < ts_plot.index) & (ts_plot.index < t+wsize), 'Temp'\n",
" ])\n",
"ts_plot = ts_plot.reset_index()\n",
"x = ts_plot['t']\n",
"y = ts_plot['Temp_MA']\n",
"x_new = np.linspace(x.min(), x.max(), 1000)\n",
"f = interp1d(x, y, kind='quadratic')\n",
"y_smooth = f(x_new)\n",
"plt.plot(x_new, y_smooth, '--', lw=0.75, label=' negative example\\npredicted risk: {:.3f}'.format(y_prob[imin]), c='tab:orange')\n",
"# plt.plot(ts_plot['t'], ts_plot['Temp_MA'], '-', lw=1, label='negative example')\n",
"plt.scatter(ts_plot['t'], ts_plot['Temp_MA'], s=5, c='tab:orange')\n",
"\n",
"plt.xlim(-10, 15)\n",
"plt.ylim(36, 39)\n",
"# plt.xlabel('Days relative to transplant')\n",
"# plt.ylabel('Temperature (Celsius)')\n",
"plt.legend()\n",
"\n",
"plt.sca(axes[1,0])\n",
"ts_plot = ts_imax[(ts_imax['t'] >= -10) & (ts_imax['t'] < 15)][['t', 'SysBP']].dropna()\n",
"wsize = 0.1\n",
"for t in ts_plot.index:\n",
" ts_plot.loc[t, 'SysBP_MA'] = np.mean(ts_plot.loc[\n",
" (t-wsize < ts_plot.index) & (ts_plot.index < t+wsize), 'SysBP'\n",
" ])\n",
"ts_plot = ts_plot.reset_index()\n",
"ts_plot = ts_plot.sort_values(by=['t'])\n",
"ts_plot = ts_plot.drop_duplicates(subset=['t'])\n",
"x = ts_plot['t']\n",
"x_new = np.linspace(x.min(), x.max(), 1000)\n",
"f = interp1d(x, y, kind='quadratic')\n",
"y_smooth = f(x_new)\n",
"plt.plot(x_new, y_smooth, '--', lw=0.75, label='positive example')\n",
"plt.scatter(ts_plot['t'], ts_plot['SysBP_MA'], s=5)\n",
"\n",
"plt.xlim(-10, 15)\n",
"# plt.ylim(85, 101)\n",
"plt.xlabel('Days relative to transplant')\n",
"plt.ylabel('SysBP (mmHg)')\n",
"# plt.legend()\n",
"plt.sca(axes[1,1])\n",
"ts_plot = ts_imin[(ts_imin['t'] >= -10) & (ts_imin['t'] < 15)][['t', 'SysBP']].dropna()\n",
"wsize = 0.1\n",
"for t in ts_plot.index:\n",
" ts_plot.loc[t, 'SysBP_MA'] = np.mean(ts_plot.loc[\n",
" (t-wsize < ts_plot.index) & (ts_plot.index < t+wsize), 'SysBP'\n",
" ])\n",
"ts_plot = ts_plot.reset_index()\n",
"ts_plot = ts_plot.sort_values(by=['t'])\n",
"ts_plot = ts_plot.drop_duplicates(subset=['t'])\n",
"x = ts_plot['t']\n",
"x_new = np.linspace(x.min(), x.max(), 1000)\n",
"f = interp1d(x, y, kind='quadratic')\n",
"y_smooth = f(x_new)\n",
"plt.plot(x_new, y_smooth, '--', lw=0.75, label='negative example', c='tab:orange')\n",
"plt.scatter(ts_plot['t'], ts_plot['SysBP_MA'], s=5, c='tab:orange')\n",
"# plt.ylabel('SysBP (mmHg)')\n",
"# plt.legend()\n",
"\n",
"for ax in axes.flat:\n",
" ax.label_outer()\n",
"\n",
"plt.savefig('fig/timeseries_Temp_SBP.svg')\n",
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}