Datasets:

ArXiv:
DOI:
License:
File size: 160,894 Bytes
0eae2d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba37a6c
0eae2d5
 
ba37a6c
 
0eae2d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba37a6c
0eae2d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba37a6c
0eae2d5
 
ba37a6c
 
0eae2d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ba37a6c
0eae2d5
 
 
 
 
 
 
 
 
ba37a6c
0eae2d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "_uuid": "a2ef2622d9d982f44f73097c44a0618969909c4c",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:29:11.369209Z",
     "iopub.status.busy": "2023-02-14T00:29:11.368879Z",
     "iopub.status.idle": "2023-02-14T00:29:14.248926Z",
     "shell.execute_reply": "2023-02-14T00:29:14.247959Z",
     "shell.execute_reply.started": "2023-02-14T00:29:11.369151Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "  var py_version = '3.4.3'.replace('rc', '-rc.').replace('.dev', '-dev.');\n",
       "  var reloading = false;\n",
       "  var Bokeh = root.Bokeh;\n",
       "\n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks;\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "    if (js_modules == null) js_modules = [];\n",
       "    if (js_exports == null) js_exports = {};\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    if (!reloading) {\n",
       "      console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    }\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "    window._bokeh_on_load = on_load\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    var skip = [];\n",
       "    if (window.requirejs) {\n",
       "      window.requirejs.config({'packages': {}, 'paths': {}, 'shim': {}});\n",
       "      root._bokeh_is_loading = css_urls.length + 0;\n",
       "    } else {\n",
       "      root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n",
       "    }\n",
       "\n",
       "    var existing_stylesheets = []\n",
       "    var links = document.getElementsByTagName('link')\n",
       "    for (var i = 0; i < links.length; i++) {\n",
       "      var link = links[i]\n",
       "      if (link.href != null) {\n",
       "\texisting_stylesheets.push(link.href)\n",
       "      }\n",
       "    }\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      if (existing_stylesheets.indexOf(url) !== -1) {\n",
       "\ton_load()\n",
       "\tcontinue;\n",
       "      }\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }    var existing_scripts = []\n",
       "    var scripts = document.getElementsByTagName('script')\n",
       "    for (var i = 0; i < scripts.length; i++) {\n",
       "      var script = scripts[i]\n",
       "      if (script.src != null) {\n",
       "\texisting_scripts.push(script.src)\n",
       "      }\n",
       "    }\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n",
       "\tif (!window.requirejs) {\n",
       "\t  on_load();\n",
       "\t}\n",
       "\tcontinue;\n",
       "      }\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "    for (var i = 0; i < js_modules.length; i++) {\n",
       "      var url = js_modules[i];\n",
       "      if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n",
       "\tif (!window.requirejs) {\n",
       "\t  on_load();\n",
       "\t}\n",
       "\tcontinue;\n",
       "      }\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      element.type = \"module\";\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "    for (const name in js_exports) {\n",
       "      var url = js_exports[name];\n",
       "      if (skip.indexOf(url) >= 0 || root[name] != null) {\n",
       "\tif (!window.requirejs) {\n",
       "\t  on_load();\n",
       "\t}\n",
       "\tcontinue;\n",
       "      }\n",
       "      var element = document.createElement('script');\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.type = \"module\";\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      element.textContent = `\n",
       "      import ${name} from \"${url}\"\n",
       "      window.${name} = ${name}\n",
       "      window._bokeh_on_load()\n",
       "      `\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "    if (!js_urls.length && !js_modules.length) {\n",
       "      on_load()\n",
       "    }\n",
       "  };\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.4.3.min.js\", \"https://cdn.holoviz.org/panel/1.4.5/dist/panel.min.js\"];\n",
       "  var js_modules = [];\n",
       "  var js_exports = {};\n",
       "  var css_urls = [];\n",
       "  var inline_js = [    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "function(Bokeh) {} // ensure no trailing comma for IE\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    if ((root.Bokeh !== undefined) || (force === true)) {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "\ttry {\n",
       "          inline_js[i].call(root, root.Bokeh);\n",
       "\t} catch(e) {\n",
       "\t  if (!reloading) {\n",
       "\t    throw e;\n",
       "\t  }\n",
       "\t}\n",
       "      }\n",
       "      // Cache old bokeh versions\n",
       "      if (Bokeh != undefined && !reloading) {\n",
       "\tvar NewBokeh = root.Bokeh;\n",
       "\tif (Bokeh.versions === undefined) {\n",
       "\t  Bokeh.versions = new Map();\n",
       "\t}\n",
       "\tif (NewBokeh.version !== Bokeh.version) {\n",
       "\t  Bokeh.versions.set(NewBokeh.version, NewBokeh)\n",
       "\t}\n",
       "\troot.Bokeh = Bokeh;\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    }\n",
       "    root._bokeh_is_initializing = false\n",
       "  }\n",
       "\n",
       "  function load_or_wait() {\n",
       "    // Implement a backoff loop that tries to ensure we do not load multiple\n",
       "    // versions of Bokeh and its dependencies at the same time.\n",
       "    // In recent versions we use the root._bokeh_is_initializing flag\n",
       "    // to determine whether there is an ongoing attempt to initialize\n",
       "    // bokeh, however for backward compatibility we also try to ensure\n",
       "    // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n",
       "    // before older versions are fully initialized.\n",
       "    if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n",
       "      root._bokeh_is_initializing = false;\n",
       "      root._bokeh_onload_callbacks = undefined;\n",
       "      console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n",
       "      load_or_wait();\n",
       "    } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n",
       "      setTimeout(load_or_wait, 100);\n",
       "    } else {\n",
       "      root._bokeh_is_initializing = true\n",
       "      root._bokeh_onload_callbacks = []\n",
       "      var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n",
       "      if (!reloading && !bokeh_loaded) {\n",
       "\troot.Bokeh = undefined;\n",
       "      }\n",
       "      load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n",
       "\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "\trun_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }\n",
       "  // Give older versions of the autoload script a head-start to ensure\n",
       "  // they initialize before we start loading newer version.\n",
       "  setTimeout(load_or_wait, 100)\n",
       "}(window));"
      ],
      "application/vnd.holoviews_load.v0+json": "(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n  var py_version = '3.4.3'.replace('rc', '-rc.').replace('.dev', '-dev.');\n  var reloading = false;\n  var Bokeh = root.Bokeh;\n\n  if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks;\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n    if (js_modules == null) js_modules = [];\n    if (js_exports == null) js_exports = {};\n\n    root._bokeh_onload_callbacks.push(callback);\n\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n      run_callbacks();\n      return null;\n    }\n    if (!reloading) {\n      console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    }\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n    window._bokeh_on_load = on_load\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    var skip = [];\n    if (window.requirejs) {\n      window.requirejs.config({'packages': {}, 'paths': {}, 'shim': {}});\n      root._bokeh_is_loading = css_urls.length + 0;\n    } else {\n      root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n    }\n\n    var existing_stylesheets = []\n    var links = document.getElementsByTagName('link')\n    for (var i = 0; i < links.length; i++) {\n      var link = links[i]\n      if (link.href != null) {\n\texisting_stylesheets.push(link.href)\n      }\n    }\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      if (existing_stylesheets.indexOf(url) !== -1) {\n\ton_load()\n\tcontinue;\n      }\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }    var existing_scripts = []\n    var scripts = document.getElementsByTagName('script')\n    for (var i = 0; i < scripts.length; i++) {\n      var script = scripts[i]\n      if (script.src != null) {\n\texisting_scripts.push(script.src)\n      }\n    }\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t  on_load();\n\t}\n\tcontinue;\n      }\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n    for (var i = 0; i < js_modules.length; i++) {\n      var url = js_modules[i];\n      if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t  on_load();\n\t}\n\tcontinue;\n      }\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      element.type = \"module\";\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n    for (const name in js_exports) {\n      var url = js_exports[name];\n      if (skip.indexOf(url) >= 0 || root[name] != null) {\n\tif (!window.requirejs) {\n\t  on_load();\n\t}\n\tcontinue;\n      }\n      var element = document.createElement('script');\n      element.onerror = on_error;\n      element.async = false;\n      element.type = \"module\";\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      element.textContent = `\n      import ${name} from \"${url}\"\n      window.${name} = ${name}\n      window._bokeh_on_load()\n      `\n      document.head.appendChild(element);\n    }\n    if (!js_urls.length && !js_modules.length) {\n      on_load()\n    }\n  };\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.4.3.min.js\", \"https://cdn.holoviz.org/panel/1.4.5/dist/panel.min.js\"];\n  var js_modules = [];\n  var js_exports = {};\n  var css_urls = [];\n  var inline_js = [    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n  ];\n\n  function run_inline_js() {\n    if ((root.Bokeh !== undefined) || (force === true)) {\n      for (var i = 0; i < inline_js.length; i++) {\n\ttry {\n          inline_js[i].call(root, root.Bokeh);\n\t} catch(e) {\n\t  if (!reloading) {\n\t    throw e;\n\t  }\n\t}\n      }\n      // Cache old bokeh versions\n      if (Bokeh != undefined && !reloading) {\n\tvar NewBokeh = root.Bokeh;\n\tif (Bokeh.versions === undefined) {\n\t  Bokeh.versions = new Map();\n\t}\n\tif (NewBokeh.version !== Bokeh.version) {\n\t  Bokeh.versions.set(NewBokeh.version, NewBokeh)\n\t}\n\troot.Bokeh = Bokeh;\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    }\n    root._bokeh_is_initializing = false\n  }\n\n  function load_or_wait() {\n    // Implement a backoff loop that tries to ensure we do not load multiple\n    // versions of Bokeh and its dependencies at the same time.\n    // In recent versions we use the root._bokeh_is_initializing flag\n    // to determine whether there is an ongoing attempt to initialize\n    // bokeh, however for backward compatibility we also try to ensure\n    // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n    // before older versions are fully initialized.\n    if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n      root._bokeh_is_initializing = false;\n      root._bokeh_onload_callbacks = undefined;\n      console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n      load_or_wait();\n    } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n      setTimeout(load_or_wait, 100);\n    } else {\n      root._bokeh_is_initializing = true\n      root._bokeh_onload_callbacks = []\n      var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n      if (!reloading && !bokeh_loaded) {\n\troot.Bokeh = undefined;\n      }\n      load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n\trun_inline_js();\n      });\n    }\n  }\n  // Give older versions of the autoload script a head-start to ensure\n  // they initialize before we start loading newer version.\n  setTimeout(load_or_wait, 100)\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "if ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n",
       "  window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n",
       "}\n",
       "\n",
       "\n",
       "    function JupyterCommManager() {\n",
       "    }\n",
       "\n",
       "    JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n",
       "      if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n",
       "        var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n",
       "        comm_manager.register_target(comm_id, function(comm) {\n",
       "          comm.on_msg(msg_handler);\n",
       "        });\n",
       "      } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n",
       "        window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n",
       "          comm.onMsg = msg_handler;\n",
       "        });\n",
       "      } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n",
       "        google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n",
       "          var messages = comm.messages[Symbol.asyncIterator]();\n",
       "          function processIteratorResult(result) {\n",
       "            var message = result.value;\n",
       "            console.log(message)\n",
       "            var content = {data: message.data, comm_id};\n",
       "            var buffers = []\n",
       "            for (var buffer of message.buffers || []) {\n",
       "              buffers.push(new DataView(buffer))\n",
       "            }\n",
       "            var metadata = message.metadata || {};\n",
       "            var msg = {content, buffers, metadata}\n",
       "            msg_handler(msg);\n",
       "            return messages.next().then(processIteratorResult);\n",
       "          }\n",
       "          return messages.next().then(processIteratorResult);\n",
       "        })\n",
       "      }\n",
       "    }\n",
       "\n",
       "    JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n",
       "      if (comm_id in window.PyViz.comms) {\n",
       "        return window.PyViz.comms[comm_id];\n",
       "      } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n",
       "        var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n",
       "        var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n",
       "        if (msg_handler) {\n",
       "          comm.on_msg(msg_handler);\n",
       "        }\n",
       "      } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n",
       "        var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n",
       "        comm.open();\n",
       "        if (msg_handler) {\n",
       "          comm.onMsg = msg_handler;\n",
       "        }\n",
       "      } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n",
       "        var comm_promise = google.colab.kernel.comms.open(comm_id)\n",
       "        comm_promise.then((comm) => {\n",
       "          window.PyViz.comms[comm_id] = comm;\n",
       "          if (msg_handler) {\n",
       "            var messages = comm.messages[Symbol.asyncIterator]();\n",
       "            function processIteratorResult(result) {\n",
       "              var message = result.value;\n",
       "              var content = {data: message.data};\n",
       "              var metadata = message.metadata || {comm_id};\n",
       "              var msg = {content, metadata}\n",
       "              msg_handler(msg);\n",
       "              return messages.next().then(processIteratorResult);\n",
       "            }\n",
       "            return messages.next().then(processIteratorResult);\n",
       "          }\n",
       "        }) \n",
       "        var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n",
       "          return comm_promise.then((comm) => {\n",
       "            comm.send(data, metadata, buffers, disposeOnDone);\n",
       "          });\n",
       "        };\n",
       "        var comm = {\n",
       "          send: sendClosure\n",
       "        };\n",
       "      }\n",
       "      window.PyViz.comms[comm_id] = comm;\n",
       "      return comm;\n",
       "    }\n",
       "    window.PyViz.comm_manager = new JupyterCommManager();\n",
       "    \n",
       "\n",
       "\n",
       "var JS_MIME_TYPE = 'application/javascript';\n",
       "var HTML_MIME_TYPE = 'text/html';\n",
       "var EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\n",
       "var CLASS_NAME = 'output';\n",
       "\n",
       "/**\n",
       " * Render data to the DOM node\n",
       " */\n",
       "function render(props, node) {\n",
       "  var div = document.createElement(\"div\");\n",
       "  var script = document.createElement(\"script\");\n",
       "  node.appendChild(div);\n",
       "  node.appendChild(script);\n",
       "}\n",
       "\n",
       "/**\n",
       " * Handle when a new output is added\n",
       " */\n",
       "function handle_add_output(event, handle) {\n",
       "  var output_area = handle.output_area;\n",
       "  var output = handle.output;\n",
       "  if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "    return\n",
       "  }\n",
       "  var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "  var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "  if (id !== undefined) {\n",
       "    var nchildren = toinsert.length;\n",
       "    var html_node = toinsert[nchildren-1].children[0];\n",
       "    html_node.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "    var scripts = [];\n",
       "    var nodelist = html_node.querySelectorAll(\"script\");\n",
       "    for (var i in nodelist) {\n",
       "      if (nodelist.hasOwnProperty(i)) {\n",
       "        scripts.push(nodelist[i])\n",
       "      }\n",
       "    }\n",
       "\n",
       "    scripts.forEach( function (oldScript) {\n",
       "      var newScript = document.createElement(\"script\");\n",
       "      var attrs = [];\n",
       "      var nodemap = oldScript.attributes;\n",
       "      for (var j in nodemap) {\n",
       "        if (nodemap.hasOwnProperty(j)) {\n",
       "          attrs.push(nodemap[j])\n",
       "        }\n",
       "      }\n",
       "      attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n",
       "      newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n",
       "      oldScript.parentNode.replaceChild(newScript, oldScript);\n",
       "    });\n",
       "    if (JS_MIME_TYPE in output.data) {\n",
       "      toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n",
       "    }\n",
       "    output_area._hv_plot_id = id;\n",
       "    if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n",
       "      window.PyViz.plot_index[id] = Bokeh.index[id];\n",
       "    } else {\n",
       "      window.PyViz.plot_index[id] = null;\n",
       "    }\n",
       "  } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "    var bk_div = document.createElement(\"div\");\n",
       "    bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "    var script_attrs = bk_div.children[0].attributes;\n",
       "    for (var i = 0; i < script_attrs.length; i++) {\n",
       "      toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "    }\n",
       "    // store reference to server id on output_area\n",
       "    output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "  }\n",
       "}\n",
       "\n",
       "/**\n",
       " * Handle when an output is cleared or removed\n",
       " */\n",
       "function handle_clear_output(event, handle) {\n",
       "  var id = handle.cell.output_area._hv_plot_id;\n",
       "  var server_id = handle.cell.output_area._bokeh_server_id;\n",
       "  if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n",
       "  var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n",
       "  if (server_id !== null) {\n",
       "    comm.send({event_type: 'server_delete', 'id': server_id});\n",
       "    return;\n",
       "  } else if (comm !== null) {\n",
       "    comm.send({event_type: 'delete', 'id': id});\n",
       "  }\n",
       "  delete PyViz.plot_index[id];\n",
       "  if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n",
       "    var doc = window.Bokeh.index[id].model.document\n",
       "    doc.clear();\n",
       "    const i = window.Bokeh.documents.indexOf(doc);\n",
       "    if (i > -1) {\n",
       "      window.Bokeh.documents.splice(i, 1);\n",
       "    }\n",
       "  }\n",
       "}\n",
       "\n",
       "/**\n",
       " * Handle kernel restart event\n",
       " */\n",
       "function handle_kernel_cleanup(event, handle) {\n",
       "  delete PyViz.comms[\"hv-extension-comm\"];\n",
       "  window.PyViz.plot_index = {}\n",
       "}\n",
       "\n",
       "/**\n",
       " * Handle update_display_data messages\n",
       " */\n",
       "function handle_update_output(event, handle) {\n",
       "  handle_clear_output(event, {cell: {output_area: handle.output_area}})\n",
       "  handle_add_output(event, handle)\n",
       "}\n",
       "\n",
       "function register_renderer(events, OutputArea) {\n",
       "  function append_mime(data, metadata, element) {\n",
       "    // create a DOM node to render to\n",
       "    var toinsert = this.create_output_subarea(\n",
       "    metadata,\n",
       "    CLASS_NAME,\n",
       "    EXEC_MIME_TYPE\n",
       "    );\n",
       "    this.keyboard_manager.register_events(toinsert);\n",
       "    // Render to node\n",
       "    var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "    render(props, toinsert[0]);\n",
       "    element.append(toinsert);\n",
       "    return toinsert\n",
       "  }\n",
       "\n",
       "  events.on('output_added.OutputArea', handle_add_output);\n",
       "  events.on('output_updated.OutputArea', handle_update_output);\n",
       "  events.on('clear_output.CodeCell', handle_clear_output);\n",
       "  events.on('delete.Cell', handle_clear_output);\n",
       "  events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n",
       "\n",
       "  OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "    safe: true,\n",
       "    index: 0\n",
       "  });\n",
       "}\n",
       "\n",
       "if (window.Jupyter !== undefined) {\n",
       "  try {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  } catch(err) {\n",
       "  }\n",
       "}\n"
      ],
      "application/vnd.holoviews_load.v0+json": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n  window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n    function JupyterCommManager() {\n    }\n\n    JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n      if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n        var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n        comm_manager.register_target(comm_id, function(comm) {\n          comm.on_msg(msg_handler);\n        });\n      } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n        window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n          comm.onMsg = msg_handler;\n        });\n      } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n        google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n          var messages = comm.messages[Symbol.asyncIterator]();\n          function processIteratorResult(result) {\n            var message = result.value;\n            console.log(message)\n            var content = {data: message.data, comm_id};\n            var buffers = []\n            for (var buffer of message.buffers || []) {\n              buffers.push(new DataView(buffer))\n            }\n            var metadata = message.metadata || {};\n            var msg = {content, buffers, metadata}\n            msg_handler(msg);\n            return messages.next().then(processIteratorResult);\n          }\n          return messages.next().then(processIteratorResult);\n        })\n      }\n    }\n\n    JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n      if (comm_id in window.PyViz.comms) {\n        return window.PyViz.comms[comm_id];\n      } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n        var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n        var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n        if (msg_handler) {\n          comm.on_msg(msg_handler);\n        }\n      } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n        var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n        comm.open();\n        if (msg_handler) {\n          comm.onMsg = msg_handler;\n        }\n      } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n        var comm_promise = google.colab.kernel.comms.open(comm_id)\n        comm_promise.then((comm) => {\n          window.PyViz.comms[comm_id] = comm;\n          if (msg_handler) {\n            var messages = comm.messages[Symbol.asyncIterator]();\n            function processIteratorResult(result) {\n              var message = result.value;\n              var content = {data: message.data};\n              var metadata = message.metadata || {comm_id};\n              var msg = {content, metadata}\n              msg_handler(msg);\n              return messages.next().then(processIteratorResult);\n            }\n            return messages.next().then(processIteratorResult);\n          }\n        }) \n        var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n          return comm_promise.then((comm) => {\n            comm.send(data, metadata, buffers, disposeOnDone);\n          });\n        };\n        var comm = {\n          send: sendClosure\n        };\n      }\n      window.PyViz.comms[comm_id] = comm;\n      return comm;\n    }\n    window.PyViz.comm_manager = new JupyterCommManager();\n    \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n  var div = document.createElement(\"div\");\n  var script = document.createElement(\"script\");\n  node.appendChild(div);\n  node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n  var output_area = handle.output_area;\n  var output = handle.output;\n  if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n    return\n  }\n  var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n  var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n  if (id !== undefined) {\n    var nchildren = toinsert.length;\n    var html_node = toinsert[nchildren-1].children[0];\n    html_node.innerHTML = output.data[HTML_MIME_TYPE];\n    var scripts = [];\n    var nodelist = html_node.querySelectorAll(\"script\");\n    for (var i in nodelist) {\n      if (nodelist.hasOwnProperty(i)) {\n        scripts.push(nodelist[i])\n      }\n    }\n\n    scripts.forEach( function (oldScript) {\n      var newScript = document.createElement(\"script\");\n      var attrs = [];\n      var nodemap = oldScript.attributes;\n      for (var j in nodemap) {\n        if (nodemap.hasOwnProperty(j)) {\n          attrs.push(nodemap[j])\n        }\n      }\n      attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n      newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n      oldScript.parentNode.replaceChild(newScript, oldScript);\n    });\n    if (JS_MIME_TYPE in output.data) {\n      toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n    }\n    output_area._hv_plot_id = id;\n    if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n      window.PyViz.plot_index[id] = Bokeh.index[id];\n    } else {\n      window.PyViz.plot_index[id] = null;\n    }\n  } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n    var bk_div = document.createElement(\"div\");\n    bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n    var script_attrs = bk_div.children[0].attributes;\n    for (var i = 0; i < script_attrs.length; i++) {\n      toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n    }\n    // store reference to server id on output_area\n    output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n  }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n  var id = handle.cell.output_area._hv_plot_id;\n  var server_id = handle.cell.output_area._bokeh_server_id;\n  if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n  var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n  if (server_id !== null) {\n    comm.send({event_type: 'server_delete', 'id': server_id});\n    return;\n  } else if (comm !== null) {\n    comm.send({event_type: 'delete', 'id': id});\n  }\n  delete PyViz.plot_index[id];\n  if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n    var doc = window.Bokeh.index[id].model.document\n    doc.clear();\n    const i = window.Bokeh.documents.indexOf(doc);\n    if (i > -1) {\n      window.Bokeh.documents.splice(i, 1);\n    }\n  }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n  delete PyViz.comms[\"hv-extension-comm\"];\n  window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n  handle_clear_output(event, {cell: {output_area: handle.output_area}})\n  handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n  function append_mime(data, metadata, element) {\n    // create a DOM node to render to\n    var toinsert = this.create_output_subarea(\n    metadata,\n    CLASS_NAME,\n    EXEC_MIME_TYPE\n    );\n    this.keyboard_manager.register_events(toinsert);\n    // Render to node\n    var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n    render(props, toinsert[0]);\n    element.append(toinsert);\n    return toinsert\n  }\n\n  events.on('output_added.OutputArea', handle_add_output);\n  events.on('output_updated.OutputArea', handle_update_output);\n  events.on('clear_output.CodeCell', handle_clear_output);\n  events.on('delete.Cell', handle_clear_output);\n  events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n  OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n    safe: true,\n    index: 0\n  });\n}\n\nif (window.Jupyter !== undefined) {\n  try {\n    var events = require('base/js/events');\n    var OutputArea = require('notebook/js/outputarea').OutputArea;\n    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n      register_renderer(events, OutputArea);\n    }\n  } catch(err) {\n  }\n}\n"
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<style>*[data-root-id],\n",
       "*[data-root-id] > * {\n",
       "  box-sizing: border-box;\n",
       "  font-family: var(--jp-ui-font-family);\n",
       "  font-size: var(--jp-ui-font-size1);\n",
       "  color: var(--vscode-editor-foreground, var(--jp-ui-font-color1));\n",
       "}\n",
       "\n",
       "/* Override VSCode background color */\n",
       ".cell-output-ipywidget-background:has(\n",
       "    > .cell-output-ipywidget-background > .lm-Widget > *[data-root-id]\n",
       "  ),\n",
       ".cell-output-ipywidget-background:has(> .lm-Widget > *[data-root-id]) {\n",
       "  background-color: transparent !important;\n",
       "}\n",
       "</style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.holoviews_exec.v0+json": "",
      "text/html": [
       "<div id='p1002'>\n",
       "  <div id=\"a6266a49-f3af-4ce9-8528-af94e75fdf60\" data-root-id=\"p1002\" style=\"display: contents;\"></div>\n",
       "</div>\n",
       "<script type=\"application/javascript\">(function(root) {\n",
       "  var docs_json = {\"b15e20b5-053f-43f7-81e9-f42b7f7a2ff6\":{\"version\":\"3.4.3\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"panel.models.browser.BrowserInfo\",\"id\":\"p1002\"},{\"type\":\"object\",\"name\":\"panel.models.comm_manager.CommManager\",\"id\":\"p1003\",\"attributes\":{\"plot_id\":\"p1002\",\"comm_id\":\"fff1afece69f4e72924ff37ad24a92f3\",\"client_comm_id\":\"7b65365c534e4bc39d2e4c1eb09be971\"}}],\"defs\":[{\"type\":\"model\",\"name\":\"ReactiveHTML1\"},{\"type\":\"model\",\"name\":\"FlexBox1\",\"properties\":[{\"name\":\"align_content\",\"kind\":\"Any\",\"default\":\"flex-start\"},{\"name\":\"align_items\",\"kind\":\"Any\",\"default\":\"flex-start\"},{\"name\":\"flex_direction\",\"kind\":\"Any\",\"default\":\"row\"},{\"name\":\"flex_wrap\",\"kind\":\"Any\",\"default\":\"wrap\"},{\"name\":\"gap\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"justify_content\",\"kind\":\"Any\",\"default\":\"flex-start\"}]},{\"type\":\"model\",\"name\":\"FloatPanel1\",\"properties\":[{\"name\":\"config\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"contained\",\"kind\":\"Any\",\"default\":true},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"right-top\"},{\"name\":\"offsetx\",\"kind\":\"Any\",\"default\":null},{\"name\":\"offsety\",\"kind\":\"Any\",\"default\":null},{\"name\":\"theme\",\"kind\":\"Any\",\"default\":\"primary\"},{\"name\":\"status\",\"kind\":\"Any\",\"default\":\"normalized\"}]},{\"type\":\"model\",\"name\":\"GridStack1\",\"properties\":[{\"name\":\"mode\",\"kind\":\"Any\",\"default\":\"warn\"},{\"name\":\"ncols\",\"kind\":\"Any\",\"default\":null},{\"name\":\"nrows\",\"kind\":\"Any\",\"default\":null},{\"name\":\"allow_resize\",\"kind\":\"Any\",\"default\":true},{\"name\":\"allow_drag\",\"kind\":\"Any\",\"default\":true},{\"name\":\"state\",\"kind\":\"Any\",\"default\":[]}]},{\"type\":\"model\",\"name\":\"drag1\",\"properties\":[{\"name\":\"slider_width\",\"kind\":\"Any\",\"default\":5},{\"name\":\"slider_color\",\"kind\":\"Any\",\"default\":\"black\"},{\"name\":\"value\",\"kind\":\"Any\",\"default\":50}]},{\"type\":\"model\",\"name\":\"click1\",\"properties\":[{\"name\":\"terminal_output\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"debug_name\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"clears\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"FastWrapper1\",\"properties\":[{\"name\":\"object\",\"kind\":\"Any\",\"default\":null},{\"name\":\"style\",\"kind\":\"Any\",\"default\":null}]},{\"type\":\"model\",\"name\":\"NotificationAreaBase1\",\"properties\":[{\"name\":\"js_events\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"bottom-right\"},{\"name\":\"_clear\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"NotificationArea1\",\"properties\":[{\"name\":\"js_events\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"notifications\",\"kind\":\"Any\",\"default\":[]},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"bottom-right\"},{\"name\":\"_clear\",\"kind\":\"Any\",\"default\":0},{\"name\":\"types\",\"kind\":\"Any\",\"default\":[{\"type\":\"map\",\"entries\":[[\"type\",\"warning\"],[\"background\",\"#ffc107\"],[\"icon\",{\"type\":\"map\",\"entries\":[[\"className\",\"fas fa-exclamation-triangle\"],[\"tagName\",\"i\"],[\"color\",\"white\"]]}]]},{\"type\":\"map\",\"entries\":[[\"type\",\"info\"],[\"background\",\"#007bff\"],[\"icon\",{\"type\":\"map\",\"entries\":[[\"className\",\"fas fa-info-circle\"],[\"tagName\",\"i\"],[\"color\",\"white\"]]}]]}]}]},{\"type\":\"model\",\"name\":\"Notification\",\"properties\":[{\"name\":\"background\",\"kind\":\"Any\",\"default\":null},{\"name\":\"duration\",\"kind\":\"Any\",\"default\":3000},{\"name\":\"icon\",\"kind\":\"Any\",\"default\":null},{\"name\":\"message\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"notification_type\",\"kind\":\"Any\",\"default\":null},{\"name\":\"_destroyed\",\"kind\":\"Any\",\"default\":false}]},{\"type\":\"model\",\"name\":\"TemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"BootstrapTemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"TemplateEditor1\",\"properties\":[{\"name\":\"layout\",\"kind\":\"Any\",\"default\":[]}]},{\"type\":\"model\",\"name\":\"MaterialTemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"copy_to_clipboard1\",\"properties\":[{\"name\":\"fill\",\"kind\":\"Any\",\"default\":\"none\"},{\"name\":\"value\",\"kind\":\"Any\",\"default\":null}]}]}};\n",
       "  var render_items = [{\"docid\":\"b15e20b5-053f-43f7-81e9-f42b7f7a2ff6\",\"roots\":{\"p1002\":\"a6266a49-f3af-4ce9-8528-af94e75fdf60\"},\"root_ids\":[\"p1002\"]}];\n",
       "  var docs = Object.values(docs_json)\n",
       "  if (!docs) {\n",
       "    return\n",
       "  }\n",
       "  const py_version = docs[0].version.replace('rc', '-rc.').replace('.dev', '-dev.')\n",
       "  async function embed_document(root) {\n",
       "    var Bokeh = get_bokeh(root)\n",
       "    await Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "    for (const render_item of render_items) {\n",
       "      for (const root_id of render_item.root_ids) {\n",
       "\tconst id_el = document.getElementById(root_id)\n",
       "\tif (id_el.children.length && id_el.children[0].hasAttribute('data-root-id')) {\n",
       "\t  const root_el = id_el.children[0]\n",
       "\t  root_el.id = root_el.id + '-rendered'\n",
       "\t  for (const child of root_el.children) {\n",
       "            // Ensure JupyterLab does not capture keyboard shortcuts\n",
       "            // see: https://jupyterlab.readthedocs.io/en/4.1.x/extension/notebook.html#keyboard-interaction-model\n",
       "\t    child.setAttribute('data-lm-suppress-shortcuts', 'true')\n",
       "\t  }\n",
       "\t}\n",
       "      }\n",
       "    }\n",
       "  }\n",
       "  function get_bokeh(root) {\n",
       "    if (root.Bokeh === undefined) {\n",
       "      return null\n",
       "    } else if (root.Bokeh.version !== py_version) {\n",
       "      if (root.Bokeh.versions === undefined || !root.Bokeh.versions.has(py_version)) {\n",
       "\treturn null\n",
       "      }\n",
       "      return root.Bokeh.versions.get(py_version);\n",
       "    } else if (root.Bokeh.version === py_version) {\n",
       "      return root.Bokeh\n",
       "    }\n",
       "    return null\n",
       "  }\n",
       "  function is_loaded(root) {\n",
       "    var Bokeh = get_bokeh(root)\n",
       "    return (Bokeh != null && Bokeh.Panel !== undefined)\n",
       "  }\n",
       "  if (is_loaded(root)) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (is_loaded(root)) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else if (document.readyState == \"complete\") {\n",
       "        attempts++;\n",
       "        if (attempts > 200) {\n",
       "          clearInterval(timer);\n",
       "\t  var Bokeh = get_bokeh(root)\n",
       "\t  if (Bokeh == null || Bokeh.Panel == null) {\n",
       "            console.warn(\"Panel: ERROR: Unable to run Panel code because Bokeh or Panel library is missing\");\n",
       "\t  } else {\n",
       "\t    console.warn(\"Panel: WARNING: Attempting to render but not all required libraries could be resolved.\")\n",
       "\t    embed_document(root)\n",
       "\t  }\n",
       "        }\n",
       "      }\n",
       "    }, 25, root)\n",
       "  }\n",
       "})(window);</script>"
      ]
     },
     "metadata": {
      "application/vnd.holoviews_exec.v0+json": {
       "id": "p1002"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pprint import pprint\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "\n",
    "import holoviews as hv\n",
    "hv.extension('bokeh', 'matplotlib', logo=False)\n",
    "\n",
    "# Avoid warnings to show up (trick for the final notebook on kaggle)\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "043e78ba82baf8748dcc07876d7b2f4a8a0678ee"
   },
   "source": [
    "# Credit risk case study\n",
    "*DISCLAIMER: This is not 100% my own code*\n",
    "\n",
    "## Table of content\n",
    "\n",
    "* [Dataset overview](#ds)\n",
    "* [Exploratory analysis](#explo)\n",
    "    * [Descritive statistics for PAID loans](#descp)\n",
    "    * [Descritive statistics for DEFAULT loans](#descd)\n",
    "    * [DEFAULT as a function of reason for aquiring the loans](#reason)\n",
    "    * [DEFAULT as a function of occupation](#occupation)\n",
    "    * [Graphical overview](#graph)\n",
    "    * [Violin plot](#violin)\n",
    "    * [Correlation matrix](#corr)\n",
    "* [Test of default classifiers](#classification)\n",
    "* [Model evaluation](#eval)\n",
    "    * [Precision & recall](#per)\n",
    "    * [F1](#f1)\n",
    "    * [Receiver operating characteristic](#roc)\n",
    "    * [Confusion matrix](#confusion)\n",
    "    * [Classification probability](#prob)\n",
    "* [Logistic regression](#logit)\n",
    "* [SGD classifier](#sgd)\n",
    "* [Supporting vector classifier](#svc)\n",
    "* [Gradient boosting classifier](#gbrt)\n",
    "* [Forest of randomized tree](#frt)\n",
    "    * [Randm forest classifier](#rfc)\n",
    "    * [Extremely randomized tree](#ert)\n",
    "* [Model comparison and conclusion](#conclusion)\n",
    "\n",
    "## Dataset overview\n",
    "<a id='ds'></a>\n",
    "\n",
    "The dataset contains baseline and loan performance information for 5,960 recent home equity loans. A home equity loan is a loan where the obligor uses the equity of his or her home as the underlying collateral. The target (BAD) is a binary variable indicating whether an applicant eventually defaulted or was seriously delinquent. This adverse outcome occurred in 1,189 cases (20%). \n",
    "\n",
    "For each applicant, 11 input variables were recorded:\n",
    "\n",
    "* BAD: 1 = applicant defaulted on loan or seriously delinquent; 0 = applicant paid loan\n",
    "* LOAN: Amount of the loan request\n",
    "* MORTDUE: Amount due on existing mortgage\n",
    "* VALUE: Value of current property\n",
    "* REASON: DebtCon = debt consolidation; HomeImp = home improvement\n",
    "* JOB: Occupational categories\n",
    "* YOJ: Years at present job\n",
    "* DEROG: Number of major derogatory reports\n",
    "* DELINQ: Number of delinquent credit lines\n",
    "* CLAGE: Age of oldest credit line in months\n",
    "* NINQ: Number of recent credit inquiries\n",
    "* CLNO: Number of credit lines"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "_uuid": "99f7547021739168db64988549a9535a5bc06a72",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:30:25.487839Z",
     "iopub.status.busy": "2023-02-14T00:30:25.487260Z",
     "iopub.status.idle": "2023-02-14T00:30:25.536426Z",
     "shell.execute_reply": "2023-02-14T00:30:25.535269Z",
     "shell.execute_reply.started": "2023-02-14T00:30:25.487777Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>BAD</th>\n",
       "      <th>LOAN</th>\n",
       "      <th>MORTDUE</th>\n",
       "      <th>VALUE</th>\n",
       "      <th>REASON</th>\n",
       "      <th>JOB</th>\n",
       "      <th>YOJ</th>\n",
       "      <th>DEROG</th>\n",
       "      <th>DELINQ</th>\n",
       "      <th>CLAGE</th>\n",
       "      <th>NINQ</th>\n",
       "      <th>CLNO</th>\n",
       "      <th>DEBTINC</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1100</td>\n",
       "      <td>25860.0</td>\n",
       "      <td>39025.0</td>\n",
       "      <td>HomeImp</td>\n",
       "      <td>Other</td>\n",
       "      <td>10.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>94.366667</td>\n",
       "      <td>1.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1300</td>\n",
       "      <td>70053.0</td>\n",
       "      <td>68400.0</td>\n",
       "      <td>HomeImp</td>\n",
       "      <td>Other</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>121.833333</td>\n",
       "      <td>0.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1500</td>\n",
       "      <td>13500.0</td>\n",
       "      <td>16700.0</td>\n",
       "      <td>HomeImp</td>\n",
       "      <td>Other</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>149.466667</td>\n",
       "      <td>1.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>1700</td>\n",
       "      <td>97800.0</td>\n",
       "      <td>112000.0</td>\n",
       "      <td>HomeImp</td>\n",
       "      <td>Office</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>93.333333</td>\n",
       "      <td>0.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   BAD  LOAN  MORTDUE     VALUE   REASON     JOB   YOJ  DEROG  DELINQ  \\\n",
       "0    1  1100  25860.0   39025.0  HomeImp   Other  10.5    0.0     0.0   \n",
       "1    1  1300  70053.0   68400.0  HomeImp   Other   7.0    0.0     2.0   \n",
       "2    1  1500  13500.0   16700.0  HomeImp   Other   4.0    0.0     0.0   \n",
       "3    1  1500      NaN       NaN      NaN     NaN   NaN    NaN     NaN   \n",
       "4    0  1700  97800.0  112000.0  HomeImp  Office   3.0    0.0     0.0   \n",
       "\n",
       "        CLAGE  NINQ  CLNO  DEBTINC  \n",
       "0   94.366667   1.0   9.0      NaN  \n",
       "1  121.833333   0.0  14.0      NaN  \n",
       "2  149.466667   1.0  10.0      NaN  \n",
       "3         NaN   NaN   NaN      NaN  \n",
       "4   93.333333   0.0  14.0      NaN  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=pd.read_csv('data/hmeq.csv')\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "689f230ab38b172609ebbf62c0810b6403b2cb14"
   },
   "source": [
    "## Exploratory analysis\n",
    "<a id='explo'></a>\n",
    "\n",
    "I summarize the main characteristics of the dataset with visual methods and summary statistics. I use the target variable (BAD) to divide the data set into sub-samples and I specifically look for variables, features and correlation which contain classification power.\n",
    "\n",
    "### Descritive statistics for PAID loans\n",
    "<a id='descp'></a>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "7714ab305dd9e853ab266438144d91dc857d38c1",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:30:26.341838Z",
     "iopub.status.busy": "2023-02-14T00:30:26.341154Z",
     "iopub.status.idle": "2023-02-14T00:30:26.433883Z",
     "shell.execute_reply": "2023-02-14T00:30:26.432942Z",
     "shell.execute_reply.started": "2023-02-14T00:30:26.341465Z"
    }
   },
   "outputs": [],
   "source": [
    "df[df['BAD']==0].drop('BAD', axis=1).describe().style.format(\"{:.2f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "bf50d833946ba558c3a5a85b9a02a7b08b60f068"
   },
   "source": [
    "### Descritive statistics for DEFAULT loans\n",
    "<a id='descd'></a>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "7ae114f0450eb4ca523d9dfb4b548d37e07bd769",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:30:27.840011Z",
     "iopub.status.busy": "2023-02-14T00:30:27.839251Z",
     "iopub.status.idle": "2023-02-14T00:30:27.892289Z",
     "shell.execute_reply": "2023-02-14T00:30:27.891359Z",
     "shell.execute_reply.started": "2023-02-14T00:30:27.839547Z"
    }
   },
   "outputs": [],
   "source": [
    "df[df['BAD']==1].drop('BAD', axis=1).describe().style.format(\"{:.2f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "15b6b46578e4bf2999ef1a750d086f8824809d28"
   },
   "source": [
    "1. From the descriptive statistics above I can draw the following consideration:\n",
    "\n",
    "* The amount of requested loan, the amount of due mortgage and the value of the underlying collateral are statistically consistent for both loans that been PAID and that resulted in a DEFAULT. This suggests that those variables may not provide significant discrimination power to separate the two classes.\n",
    "\n",
    "\n",
    "* The number of years at the present job (YOJ) seems to discriminate the two classes as DEFAULTs seem more frequent in contractors which have a shorter seniority. This tendency is supported by the correspoding average value quantiles which indicate a distribution skewed toward shorter seniority.\n",
    "\n",
    "* A similar considerations apply to variables related to the contractor credit history such as: the number of major derogatory reports (DEROG), the number of delinquent credit lines (DELINQ), the age of oldest credit line in months (CLAGE), and the number of recent credit inquiries (NINQ). In the case of DEFAULT the distribution of these variables is skewed toward values that suggest a credit hystory that is worse than the corresponding distribution for PAID loan contractors.\n",
    "\n",
    "\n",
    "* Finally, the number of open credit line (CLNO) seems statistically consistent in both case, suggesting that this variable has no significant discrimination power."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "_uuid": "f8539626c720ae398e548fa3ae509317aa8b5bf1",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:30:29.896064Z",
     "iopub.status.busy": "2023-02-14T00:30:29.895514Z",
     "iopub.status.idle": "2023-02-14T00:30:29.912013Z",
     "shell.execute_reply": "2023-02-14T00:30:29.911291Z",
     "shell.execute_reply.started": "2023-02-14T00:30:29.895990Z"
    }
   },
   "outputs": [],
   "source": [
    "df.loc[df.BAD == 1, 'STATUS'] = 'DEFAULT'\n",
    "df.loc[df.BAD == 0, 'STATUS'] = 'PAID'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "cd6a0d12befc4ce3733c3f0c340e393bd512da9f"
   },
   "source": [
    "### DEFAULT as a function of the reason for aquiring the loans\n",
    "<a id='reason'></a>\n",
    "The fraction of PAID and DEFAULT loans do not seem to depend strongly on the reason for acquiring the loan. On average, 80% of the loans have been payed while about the 20% DEFAULT. The 2% discrepancy observed is not statistically significant given the amount of loans in the dataset."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "b6ea91d888b48ee9274cd26f85456665fb293ce1",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:30:32.224034Z",
     "iopub.status.busy": "2023-02-14T00:30:32.223550Z",
     "iopub.status.idle": "2023-02-14T00:30:32.239315Z",
     "shell.execute_reply": "2023-02-14T00:30:32.238323Z",
     "shell.execute_reply.started": "2023-02-14T00:30:32.223986Z"
    }
   },
   "outputs": [],
   "source": [
    "g = df.groupby('REASON')\n",
    "g['STATUS'].value_counts(normalize=True).to_frame().style.format(\"{:.1%}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "4ae118a39513b77d1748e7c0aaeefd5f693e801b"
   },
   "source": [
    "###  DEFAULT as a function of the occupation\n",
    "<a id='occupation'></a>\n",
    "The fraction of PAID and DEFAULT loans show some dependence on the occupation of the contractor. Office worker and professional executives have the highest probability to pay their loans while sales and self employed have the highest probability to default. The occupation shows a good discriminating power and it will  most likely be an important feature of our classification model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "14c58774c8872b1e0a932d70dd121eebbbbac460",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:52:26.321779Z",
     "iopub.status.busy": "2023-02-14T00:52:26.321447Z",
     "iopub.status.idle": "2023-02-14T00:52:26.336967Z",
     "shell.execute_reply": "2023-02-14T00:52:26.336097Z",
     "shell.execute_reply.started": "2023-02-14T00:52:26.321738Z"
    }
   },
   "outputs": [],
   "source": [
    "g = df.groupby('JOB')\n",
    "g['STATUS'].value_counts(normalize=True).to_frame().style.format(\"{:.1%}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "62bc0016776d966c4b7069677998f6cd634da494",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:53:41.486446Z",
     "iopub.status.busy": "2023-02-14T00:53:41.486074Z",
     "iopub.status.idle": "2023-02-14T00:53:41.818567Z",
     "shell.execute_reply": "2023-02-14T00:53:41.817589Z",
     "shell.execute_reply.started": "2023-02-14T00:53:41.486393Z"
    }
   },
   "outputs": [],
   "source": [
    "%%opts Bars[width=700 height=400 tools=['hover'] xrotation=45]{+axiswise +framewise}\n",
    "\n",
    "# Categorical\n",
    "\n",
    "cols = ['REASON', 'JOB']\n",
    "\n",
    "dd={}\n",
    "\n",
    "for col in cols:\n",
    "\n",
    "    counts=df.groupby(col)['STATUS'].value_counts(normalize=True).to_frame('val').reset_index()\n",
    "    dd[col] = hv.Bars(counts, [col, 'STATUS'], 'val') \n",
    "    \n",
    "var = [*dd]\n",
    "kdims=hv.Dimension(('var', 'Variable'), values=var)    \n",
    "hv.HoloMap(dd, kdims=kdims)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "145c45f430d806214a84bf90a0855bd0fb97d937"
   },
   "source": [
    "### Graphical overview\n",
    "<a id='graph'></a>\n",
    "A coherent graphical overview of the dataset is shown below. For each variable I show an histogram for the whole dataset, for the PAID, and DEFUALT loans, respectively. The correlations among variables are also sumamrized in 2-dimensinal scatter plots."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "_uuid": "e6b5c5ed3ca124dfa07a73cd3137e845b6539f5d",
    "execution": {
     "iopub.execute_input": "2023-02-14T00:54:01.566453Z",
     "iopub.status.busy": "2023-02-14T00:54:01.565746Z",
     "iopub.status.idle": "2023-02-14T00:54:01.819990Z",
     "shell.execute_reply": "2023-02-14T00:54:01.819175Z",
     "shell.execute_reply.started": "2023-02-14T00:54:01.566008Z"
    }
   },
   "outputs": [
    {
     "data": {},
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.holoviews_exec.v0+json": "",
      "text/html": [
       "<div id='p1004'>\n",
       "  <div id=\"cb3b968a-d8e8-469d-933b-17956028b140\" data-root-id=\"p1004\" style=\"display: contents;\"></div>\n",
       "</div>\n",
       "<script type=\"application/javascript\">(function(root) {\n",
       "  var docs_json = {\"62c794f4-24ad-4dfa-b836-d731f0955427\":{\"version\":\"3.4.3\",\"title\":\"Bokeh Application\",\"roots\":[{\"type\":\"object\",\"name\":\"Row\",\"id\":\"p1004\",\"attributes\":{\"name\":\"Row01955\",\"tags\":[\"embedded\"],\"stylesheets\":[\"\\n:host(.pn-loading):before, .pn-loading:before {\\n  background-color: #c3c3c3;\\n  mask-size: auto calc(min(50%, 400px));\\n  -webkit-mask-size: auto calc(min(50%, 400px));\\n}\",{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1007\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/css/loading.css\"}},{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1101\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/css/listpanel.css\"}},{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1005\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/bundled/theme/default.css\"}},{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1006\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/bundled/theme/native.css\"}}],\"min_width\":300,\"margin\":0,\"sizing_mode\":\"stretch_width\",\"align\":\"start\",\"children\":[{\"type\":\"object\",\"name\":\"Spacer\",\"id\":\"p1008\",\"attributes\":{\"name\":\"HSpacer01965\",\"stylesheets\":[\"\\n:host(.pn-loading):before, .pn-loading:before {\\n  background-color: #c3c3c3;\\n  mask-size: auto calc(min(50%, 400px));\\n  -webkit-mask-size: auto calc(min(50%, 400px));\\n}\",{\"id\":\"p1007\"},{\"id\":\"p1005\"},{\"id\":\"p1006\"}],\"margin\":0,\"sizing_mode\":\"stretch_width\",\"align\":\"start\"}},{\"type\":\"object\",\"name\":\"Figure\",\"id\":\"p1019\",\"attributes\":{\"width\":300,\"height\":300,\"margin\":[5,10],\"sizing_mode\":\"fixed\",\"align\":\"start\",\"x_range\":{\"type\":\"object\",\"name\":\"Range1d\",\"id\":\"p1009\",\"attributes\":{\"tags\":[[[\" \",null]],[]],\"start\":-85590.90000000001,\"end\":941499.9,\"reset_start\":-85590.90000000001,\"reset_end\":941499.9}},\"y_range\":{\"type\":\"object\",\"name\":\"Range1d\",\"id\":\"p1010\",\"attributes\":{\"tags\":[[[\"Frequency\",null]],{\"type\":\"map\",\"entries\":[[\"invert_yaxis\",false],[\"autorange\",false]]}],\"end\":5316.3,\"reset_start\":0.0,\"reset_end\":5316.3}},\"x_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1029\"},\"y_scale\":{\"type\":\"object\",\"name\":\"LinearScale\",\"id\":\"p1030\"},\"title\":{\"type\":\"object\",\"name\":\"Title\",\"id\":\"p1022\",\"attributes\":{\"text\":\"Variable: LOAN\",\"text_color\":\"black\",\"text_font_size\":\"12pt\"}},\"renderers\":[{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1059\",\"attributes\":{\"name\":\"ALL Loans\",\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1050\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1051\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1052\"},\"data\":{\"type\":\"map\",\"entries\":[[\"top\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"agQAAJcJAAAwBgAAowEAALgAAAByAAAAEgAAABoAAAANAAAAEQAAAA==\"},\"shape\":[10],\"dtype\":\"int32\",\"order\":\"little\"}],[\"left\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}],[\"right\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1060\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1061\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1056\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"hatch_color\":{\"type\":\"value\",\"value\":\"#30a2da\"}}},\"selection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1064\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_color\":{\"type\":\"value\",\"value\":\"black\"},\"line_alpha\":{\"type\":\"value\",\"value\":1.0},\"line_width\":{\"type\":\"value\",\"value\":1},\"line_join\":{\"type\":\"value\",\"value\":\"bevel\"},\"line_cap\":{\"type\":\"value\",\"value\":\"butt\"},\"line_dash\":{\"type\":\"value\",\"value\":[]},\"line_dash_offset\":{\"type\":\"value\",\"value\":0},\"fill_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"fill_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_scale\":{\"type\":\"value\",\"value\":12.0},\"hatch_pattern\":{\"type\":\"value\",\"value\":null},\"hatch_weight\":{\"type\":\"value\",\"value\":1.0}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1057\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1058\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_color\":{\"type\":\"value\",\"value\":\"#30a2da\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}},{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1074\",\"attributes\":{\"name\":\"PAID Loans\",\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1065\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1066\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1067\"},\"data\":{\"type\":\"map\",\"entries\":[[\"top\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"KAMAAL8HAAA3BQAAaQEAAIcAAABVAAAADwAAABgAAAAIAAAAEQAAAA==\"},\"shape\":[10],\"dtype\":\"int32\",\"order\":\"little\"}],[\"left\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}],[\"right\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1075\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1076\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1071\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"hatch_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"}}},\"selection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1078\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_color\":{\"type\":\"value\",\"value\":\"black\"},\"line_alpha\":{\"type\":\"value\",\"value\":1.0},\"line_width\":{\"type\":\"value\",\"value\":1},\"line_join\":{\"type\":\"value\",\"value\":\"bevel\"},\"line_cap\":{\"type\":\"value\",\"value\":\"butt\"},\"line_dash\":{\"type\":\"value\",\"value\":[]},\"line_dash_offset\":{\"type\":\"value\",\"value\":0},\"fill_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"fill_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_scale\":{\"type\":\"value\",\"value\":12.0},\"hatch_pattern\":{\"type\":\"value\",\"value\":null},\"hatch_weight\":{\"type\":\"value\",\"value\":1.0}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1072\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1073\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_color\":{\"type\":\"value\",\"value\":\"#fc4f30\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}},{\"type\":\"object\",\"name\":\"GlyphRenderer\",\"id\":\"p1088\",\"attributes\":{\"name\":\"DEFAULT Loans\",\"data_source\":{\"type\":\"object\",\"name\":\"ColumnDataSource\",\"id\":\"p1079\",\"attributes\":{\"selected\":{\"type\":\"object\",\"name\":\"Selection\",\"id\":\"p1080\",\"attributes\":{\"indices\":[],\"line_indices\":[]}},\"selection_policy\":{\"type\":\"object\",\"name\":\"UnionRenderers\",\"id\":\"p1081\"},\"data\":{\"type\":\"map\",\"entries\":[[\"top\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"QgEAANgBAAD5AAAAOgAAADEAAAAdAAAAAwAAAAIAAAAFAAAAAAAAAA==\"},\"shape\":[10],\"dtype\":\"int32\",\"order\":\"little\"}],[\"left\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}],[\"right\",{\"type\":\"ndarray\",\"array\":{\"type\":\"bytes\",\"data\":\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\"},\"shape\":[10],\"dtype\":\"float64\",\"order\":\"little\"}]]}}},\"view\":{\"type\":\"object\",\"name\":\"CDSView\",\"id\":\"p1089\",\"attributes\":{\"filter\":{\"type\":\"object\",\"name\":\"AllIndices\",\"id\":\"p1090\"}}},\"glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1085\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"fill_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"hatch_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"}}},\"selection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1092\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_color\":{\"type\":\"value\",\"value\":\"black\"},\"line_alpha\":{\"type\":\"value\",\"value\":1.0},\"line_width\":{\"type\":\"value\",\"value\":1},\"line_join\":{\"type\":\"value\",\"value\":\"bevel\"},\"line_cap\":{\"type\":\"value\",\"value\":\"butt\"},\"line_dash\":{\"type\":\"value\",\"value\":[]},\"line_dash_offset\":{\"type\":\"value\",\"value\":0},\"fill_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"fill_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":1.0},\"hatch_scale\":{\"type\":\"value\",\"value\":12.0},\"hatch_pattern\":{\"type\":\"value\",\"value\":null},\"hatch_weight\":{\"type\":\"value\",\"value\":1.0}}},\"nonselection_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1086\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.1},\"fill_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.1},\"hatch_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.1}}},\"muted_glyph\":{\"type\":\"object\",\"name\":\"Quad\",\"id\":\"p1087\",\"attributes\":{\"tags\":[\"apply_ranges\"],\"left\":{\"type\":\"field\",\"field\":\"left\"},\"right\":{\"type\":\"field\",\"field\":\"right\"},\"bottom\":{\"type\":\"value\",\"value\":0},\"top\":{\"type\":\"field\",\"field\":\"top\"},\"line_alpha\":{\"type\":\"value\",\"value\":0.2},\"fill_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"fill_alpha\":{\"type\":\"value\",\"value\":0.2},\"hatch_color\":{\"type\":\"value\",\"value\":\"#e5ae38\"},\"hatch_alpha\":{\"type\":\"value\",\"value\":0.2}}}}}],\"toolbar\":{\"type\":\"object\",\"name\":\"Toolbar\",\"id\":\"p1028\",\"attributes\":{\"tools\":[{\"type\":\"object\",\"name\":\"WheelZoomTool\",\"id\":\"p1014\",\"attributes\":{\"tags\":[\"hv_created\"],\"renderers\":\"auto\",\"zoom_together\":\"none\"}},{\"type\":\"object\",\"name\":\"SaveTool\",\"id\":\"p1041\"},{\"type\":\"object\",\"name\":\"PanTool\",\"id\":\"p1042\"},{\"type\":\"object\",\"name\":\"BoxZoomTool\",\"id\":\"p1043\",\"attributes\":{\"overlay\":{\"type\":\"object\",\"name\":\"BoxAnnotation\",\"id\":\"p1044\",\"attributes\":{\"syncable\":false,\"level\":\"overlay\",\"visible\":false,\"left\":{\"type\":\"number\",\"value\":\"nan\"},\"right\":{\"type\":\"number\",\"value\":\"nan\"},\"top\":{\"type\":\"number\",\"value\":\"nan\"},\"bottom\":{\"type\":\"number\",\"value\":\"nan\"},\"left_units\":\"canvas\",\"right_units\":\"canvas\",\"top_units\":\"canvas\",\"bottom_units\":\"canvas\",\"line_color\":\"black\",\"line_alpha\":1.0,\"line_width\":2,\"line_dash\":[4,4],\"fill_color\":\"lightgrey\",\"fill_alpha\":0.5}}}},{\"type\":\"object\",\"name\":\"ResetTool\",\"id\":\"p1049\"}],\"active_drag\":{\"id\":\"p1042\"},\"active_scroll\":{\"id\":\"p1014\"}}},\"left\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1036\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1037\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1038\"},\"axis_label\":\"Frequency\",\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1039\"}}}],\"below\":[{\"type\":\"object\",\"name\":\"LinearAxis\",\"id\":\"p1031\",\"attributes\":{\"ticker\":{\"type\":\"object\",\"name\":\"BasicTicker\",\"id\":\"p1032\",\"attributes\":{\"mantissas\":[1,2,5]}},\"formatter\":{\"type\":\"object\",\"name\":\"BasicTickFormatter\",\"id\":\"p1033\"},\"axis_label\":\" \",\"major_label_policy\":{\"type\":\"object\",\"name\":\"AllLabels\",\"id\":\"p1034\"}}}],\"center\":[{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1035\",\"attributes\":{\"axis\":{\"id\":\"p1031\"},\"grid_line_color\":null}},{\"type\":\"object\",\"name\":\"Grid\",\"id\":\"p1040\",\"attributes\":{\"dimension\":1,\"axis\":{\"id\":\"p1036\"},\"grid_line_color\":null}},{\"type\":\"object\",\"name\":\"Legend\",\"id\":\"p1062\",\"attributes\":{\"click_policy\":\"mute\",\"items\":[{\"type\":\"object\",\"name\":\"LegendItem\",\"id\":\"p1063\",\"attributes\":{\"label\":{\"type\":\"value\",\"value\":\"ALL Loans\"},\"renderers\":[{\"id\":\"p1059\"}]}},{\"type\":\"object\",\"name\":\"LegendItem\",\"id\":\"p1077\",\"attributes\":{\"label\":{\"type\":\"value\",\"value\":\"PAID Loans\"},\"renderers\":[{\"id\":\"p1074\"}]}},{\"type\":\"object\",\"name\":\"LegendItem\",\"id\":\"p1091\",\"attributes\":{\"label\":{\"type\":\"value\",\"value\":\"DEFAULT Loans\"},\"renderers\":[{\"id\":\"p1088\"}]}}]}}],\"min_border_top\":10,\"min_border_bottom\":10,\"min_border_left\":10,\"min_border_right\":10,\"output_backend\":\"webgl\",\"hold_render\":false}},{\"type\":\"object\",\"name\":\"Spacer\",\"id\":\"p1094\",\"attributes\":{\"name\":\"HSpacer01966\",\"stylesheets\":[\"\\n:host(.pn-loading):before, .pn-loading:before {\\n  background-color: #c3c3c3;\\n  mask-size: auto calc(min(50%, 400px));\\n  -webkit-mask-size: auto calc(min(50%, 400px));\\n}\",{\"id\":\"p1007\"},{\"id\":\"p1005\"},{\"id\":\"p1006\"}],\"margin\":0,\"sizing_mode\":\"stretch_width\",\"align\":\"start\"}},{\"type\":\"object\",\"name\":\"panel.models.layout.Column\",\"id\":\"p1095\",\"attributes\":{\"name\":\"WidgetBox01956\",\"css_classes\":[\"panel-widget-box\"],\"stylesheets\":[\"\\n:host(.pn-loading):before, .pn-loading:before {\\n  background-color: #c3c3c3;\\n  mask-size: auto calc(min(50%, 400px));\\n  -webkit-mask-size: auto calc(min(50%, 400px));\\n}\",{\"id\":\"p1007\"},{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1100\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/css/widgetbox.css\"}},{\"id\":\"p1101\"},{\"id\":\"p1005\"},{\"id\":\"p1006\"}],\"margin\":0,\"align\":[\"end\",\"center\"],\"children\":[{\"type\":\"object\",\"name\":\"panel.models.widgets.CustomSelect\",\"id\":\"p1098\",\"attributes\":{\"js_property_callbacks\":{\"type\":\"map\",\"entries\":[[\"change:value\",[{\"type\":\"object\",\"name\":\"CustomJS\",\"id\":\"p1105\",\"attributes\":{\"code\":\"\\nvar state = null\\nfor (var root of cb_obj.document.roots()) {\\n  if (root.id == 'p1104') {\\n    state = root;\\n    break;\\n  }\\n}\\nif (!state) { return; }\\nstate.set_state(cb_obj, cb_obj.value)\\n\"}}]]]},\"stylesheets\":[\"\\n:host(.pn-loading):before, .pn-loading:before {\\n  background-color: #c3c3c3;\\n  mask-size: auto calc(min(50%, 400px));\\n  -webkit-mask-size: auto calc(min(50%, 400px));\\n}\",{\"id\":\"p1007\"},{\"type\":\"object\",\"name\":\"ImportedStyleSheet\",\"id\":\"p1097\",\"attributes\":{\"url\":\"https://cdn.holoviz.org/panel/1.4.5/dist/css/select.css\"}},{\"id\":\"p1005\"},{\"id\":\"p1006\"}],\"width\":300,\"min_width\":300,\"margin\":[5,10],\"align\":\"start\",\"title\":\"Variable\",\"options\":[\"LOAN\",\"MORTDUE\",\"VALUE\",\"YOJ\",\"DEROG\",\"DELINQ\",\"CLAGE\",\"NINQ\",\"CLNO\"],\"value\":\"LOAN\"}}]}}]}},{\"type\":\"object\",\"name\":\"panel.models.state.State\",\"id\":\"p1104\",\"attributes\":{\"state\":{\"type\":\"map\",\"entries\":[[\"CLNO\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1115\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYcQGZmZmZmZixAzMzMzMxMNUBmZmZmZmY8QAAAAAAAwEFAzMzMzMxMRUCZmZmZmdlIQGZmZmZmZkxAMzMzMzPzT0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"VgEAAEQEAADNBgAAdwUAAKgCAAAJAQAAggAAAEoAAAAFAAAACgAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmHEBmZmZmZmYsQMzMzMzMTDVAZmZmZmZmPEAAAAAAAMBBQMzMzMzMTEVAmZmZmZnZSEBmZmZmZmZMQDMzMzMz809AAAAAAADAUUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYcQGZmZmZmZixAzMzMzMxMNUBmZmZmZmY8QAAAAAAAwEFAzMzMzMxMRUCZmZmZmdlIQGZmZmZmZkxAMzMzMzPzT0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"5AAAAGYDAACnBQAAfwQAACACAADHAAAAZAAAAD8AAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmHEBmZmZmZmYsQMzMzMzMTDVAZmZmZmZmPEAAAAAAAMBBQMzMzMzMTEVAmZmZmZnZSEBmZmZmZmZMQDMzMzMz809AAAAAAADAUUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYcQGZmZmZmZixAzMzMzMxMNUBmZmZmZmY8QAAAAAAAwEFAzMzMzMxMRUCZmZmZmdlIQGZmZmZmZkxAMzMzMzPzT0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"cgAAAN4AAAAmAQAA+AAAAIgAAABCAAAAHgAAAAsAAAAFAAAACgAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmHEBmZmZmZmYsQMzMzMzMTDVAZmZmZmZmPEAAAAAAAMBBQMzMzMzMTEVAmZmZmZnZSEBmZmZmZmZMQDMzMzMz809AAAAAAADAUUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: CLNO\\\"}]}\"]]}],[\"NINQ\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1125\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAzMzMzMzP7PzMzMzMzMwtAZmZmZmZmFEAzMzMzMzMbQAAAAAAAACFAZmZmZmZmJEDNzMzMzMwnQDMzMzMzMytAmZmZmZmZLkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"Hg8AAJQEAADnAAAAOAAAAEIAAAAnAAAACgAAAAQAAAABAAAAAQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"MzMzMzMz+z8zMzMzMzMLQGZmZmZmZhRAMzMzMzMzG0AAAAAAAAAhQGZmZmZmZiRAzczMzMzMJ0AzMzMzMzMrQJmZmZmZmS5AAAAAAAAAMUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAzMzMzMzP7PzMzMzMzMwtAZmZmZmZmFEAzMzMzMzMbQAAAAAAAACFAZmZmZmZmJEDNzMzMzMwnQDMzMzMzMytAmZmZmZmZLkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"lAwAAHQDAACGAAAAGwAAACgAAAAYAAAABwAAAAAAAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"MzMzMzMz+z8zMzMzMzMLQGZmZmZmZhRAMzMzMzMzG0AAAAAAAAAhQGZmZmZmZiRAzczMzMzMJ0AzMzMzMzMrQJmZmZmZmS5AAAAAAAAAMUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAzMzMzMzP7PzMzMzMzMwtAZmZmZmZmFEAzMzMzMzMbQAAAAAAAACFAZmZmZmZmJEDNzMzMzMwnQDMzMzMzMytAmZmZmZmZLkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"igIAACABAABhAAAAHQAAABoAAAAPAAAAAwAAAAQAAAABAAAAAQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"MzMzMzMz+z8zMzMzMzMLQGZmZmZmZhRAMzMzMzMzG0AAAAAAAAAhQGZmZmZmZiRAzczMzMzMJ0AzMzMzMzMrQJmZmZmZmS5AAAAAAAAAMUA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: NINQ\\\"}]}\"]]}],[\"CLAGE\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1135\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAADL4L3dsTRdQMvgvd2xNG1AmGhOZoXndUDL4L3dsTR9QH+slirvQIJAmGhOZoXnhUCyJAaiG46JQMvgvd2xNI1Acs66DKRtkEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"vwUAAO8KAADUBAAAdQAAAAkAAAASAAAAAAAAAAAAAAAAAAAAAgAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"y+C93bE0XUDL4L3dsTRtQJhoTmaF53VAy+C93bE0fUB/rJYq70CCQJhoTmaF54VAsiQGohuOiUDL4L3dsTSNQHLOugykbZBAf6yWKu9AkkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAADL4L3dsTRdQMvgvd2xNG1AmGhOZoXndUDL4L3dsTR9QH+slirvQIJAmGhOZoXnhUCyJAaiG46JQMvgvd2xNI1Acs66DKRtkEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"HAQAAMwIAABQBAAAawAAAAgAAAASAAAAAAAAAAAAAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"y+C93bE0XUDL4L3dsTRtQJhoTmaF53VAy+C93bE0fUB/rJYq70CCQJhoTmaF54VAsiQGohuOiUDL4L3dsTSNQHLOugykbZBAf6yWKu9AkkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAADL4L3dsTRdQMvgvd2xNG1AmGhOZoXndUDL4L3dsTR9QH+slirvQIJAmGhOZoXnhUCyJAaiG46JQMvgvd2xNI1Acs66DKRtkEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"owEAACMCAACEAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"y+C93bE0XUDL4L3dsTRtQJhoTmaF53VAy+C93bE0fUB/rJYq70CCQJhoTmaF54VAsiQGohuOiUDL4L3dsTSNQHLOugykbZBAf6yWKu9AkkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: CLAGE\\\"}]}\"]]}],[\"DELINQ\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1145\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAAD4PwAAAAAAAAhAAAAAAAAAEkAAAAAAAAAYQAAAAAAAAB5AAAAAAAAAIkAAAAAAAAAlQAAAAAAAAChAAAAAAAAAK0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"4RIAAPoAAADPAAAAJgAAACgAAAAFAAAAAgAAAAIAAAACAAAAAQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA+D8AAAAAAAAIQAAAAAAAABJAAAAAAAAAGEAAAAAAAAAeQAAAAAAAACJAAAAAAAAAJUAAAAAAAAAoQAAAAAAAACtAAAAAAAAALkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAAD4PwAAAAAAAAhAAAAAAAAAEkAAAAAAAAAYQAAAAAAAAB5AAAAAAAAAIkAAAAAAAAAlQAAAAAAAAChAAAAAAAAAK0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"vA8AAIoAAABaAAAABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA+D8AAAAAAAAIQAAAAAAAABJAAAAAAAAAGEAAAAAAAAAeQAAAAAAAACJAAAAAAAAAJUAAAAAAAAAoQAAAAAAAACtAAAAAAAAALkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAAD4PwAAAAAAAAhAAAAAAAAAEkAAAAAAAAAYQAAAAAAAAB5AAAAAAAAAIkAAAAAAAAAlQAAAAAAAAChAAAAAAAAAK0A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"JQMAAHAAAAB1AAAAHwAAACgAAAAFAAAAAgAAAAIAAAACAAAAAQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA+D8AAAAAAAAIQAAAAAAAABJAAAAAAAAAGEAAAAAAAAAeQAAAAAAAACJAAAAAAAAAJUAAAAAAAAAoQAAAAAAAACtAAAAAAAAALkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: DELINQ\\\"}]}\"]]}],[\"DEROG\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1155\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAABAAAAAAAAACEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAGEAAAAAAAAAcQAAAAAAAACBAAAAAAAAAIkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"rxEAALMBAACgAAAAOgAAABcAAAAPAAAADwAAAAgAAAAGAAAABQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQAAAAAAAACJAAAAAAAAAJEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAABAAAAAAAAACEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAGEAAAAAAAAAcQAAAAAAAACBAAAAAAAAAIkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"vQ4AAAoBAABOAAAADwAAAAUAAAAIAAAABQAAAAAAAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQAAAAAAAACJAAAAAAAAAJEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAAAAAAAAAADwPwAAAAAAAABAAAAAAAAACEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAGEAAAAAAAAAcQAAAAAAAACBAAAAAAAAAIkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"8gIAAKkAAABSAAAAKwAAABIAAAAHAAAACgAAAAgAAAAGAAAABQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQAAAAAAAABhAAAAAAAAAHEAAAAAAAAAgQAAAAAAAACJAAAAAAAAAJEA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: DEROG\\\"}]}\"]]}],[\"YOJ\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1165\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYQQGZmZmZmZiBAmZmZmZmZKEBmZmZmZmYwQAAAAAAAgDRAmZmZmZmZOEAyMzMzM7M8QGZmZmZmZkBAMzMzMzNzQkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"aAcAAJ4EAACRAwAALQIAAFQBAAAiAQAAsQAAAEkAAAAOAAAAAwAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmEEBmZmZmZmYgQJmZmZmZmShAZmZmZmZmMEAAAAAAAIA0QJmZmZmZmThAMjMzMzOzPEBmZmZmZmZAQDMzMzMzc0JAAAAAAACAREA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYQQGZmZmZmZiBAmZmZmZmZKEBmZmZmZmYwQAAAAAAAgDRAmZmZmZmZOEAyMzMzM7M8QGZmZmZmZkBAMzMzMzNzQkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"pAUAAL0DAADXAgAAuQEAAAkBAAACAQAAmQAAAEEAAAALAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmEEBmZmZmZmYgQJmZmZmZmShAZmZmZmZmMEAAAAAAAIA0QJmZmZmZmThAMjMzMzOzPEBmZmZmZmZAQDMzMzMzc0JAAAAAAACAREA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAAAABmZmZmZmYQQGZmZmZmZiBAmZmZmZmZKEBmZmZmZmYwQAAAAAAAgDRAmZmZmZmZOEAyMzMzM7M8QGZmZmZmZkBAMzMzMzNzQkA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"xAEAAOEAAAC6AAAAdAAAAEsAAAAgAAAAGAAAAAgAAAADAAAAAwAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZmZmEEBmZmZmZmYgQJmZmZmZmShAZmZmZmZmMEAAAAAAAIA0QJmZmZmZmThAMjMzMzOzPEBmZmZmZmZAQDMzMzMzc0JAAAAAAACAREA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: YOJ\\\"}]}\"]]}],[\"VALUE\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1175\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAABAv0BmZmZmbqf2QGZmZmZurQVBzMzMzJIDEEFmZmZmbjAVQQAAAABKXRpBmZmZmSWKH0GZmZmZgFsiQWZmZmbu8SRBMzMzM1yIJ0E=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"RQwAAGsIAAC4AQAAXgAAAAIAAAAMAAAAAAAAAAAAAAAAAAAABAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZm6n9kBmZmZmbq0FQczMzMySAxBBZmZmZm4wFUEAAAAASl0aQZmZmZklih9BmZmZmYBbIkFmZmZm7vEkQTMzMzNciCdBAAAAAMoeKkE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAABAv0BmZmZmbqf2QGZmZmZurQVBzMzMzJIDEEFmZmZmbjAVQQAAAABKXRpBmZmZmSWKH0GZmZmZgFsiQWZmZmbu8SRBMzMzM1yIJ0E=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"sAkAABkHAAB+AQAATAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZm6n9kBmZmZmbq0FQczMzMySAxBBZmZmZm4wFUEAAAAASl0aQZmZmZklih9BmZmZmYBbIkFmZmZm7vEkQTMzMzNciCdBAAAAAMoeKkE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAABAv0BmZmZmbqf2QGZmZmZurQVBzMzMzJIDEEFmZmZmbjAVQQAAAABKXRpBmZmZmSWKH0GZmZmZgFsiQWZmZmbu8SRBMzMzM1yIJ0E=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"lQIAAFIBAAA6AAAAEgAAAAIAAAADAAAAAAAAAAAAAAAAAAAABAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZm6n9kBmZmZmbq0FQczMzMySAxBBZmZmZm4wFUEAAAAASl0aQZmZmZklih9BmZmZmYBbIkFmZmZm7vEkQTMzMzNciCdBAAAAAMoeKkE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: VALUE\\\"}]}\"]]}],[\"MORTDUE\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1185\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAeoEBmZmZmdmrkQGZmZmaG6fNAmZmZmdGd/UBmZmZmDqkDQQAAAAA0gwhBmZmZmVldDUGZmZmZvxsRQWZmZmbSiBNBMzMzM+X1FUE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"RwQAAAYKAABbBAAAtwEAAHgAAABTAAAACQAAAAEAAAABAAAADQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZnZq5EBmZmZmhunzQJmZmZnRnf1AZmZmZg6pA0EAAAAANIMIQZmZmZlZXQ1BmZmZmb8bEUFmZmZm0ogTQTMzMzPl9RVBAAAAAPhiGEE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAeoEBmZmZmdmrkQGZmZmaG6fNAmZmZmdGd/UBmZmZmDqkDQQAAAAA0gwhBmZmZmVldDUGZmZmZvxsRQWZmZmbSiBNBMzMzM+X1FUE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"JwMAABoIAACkAwAAcwEAAFoAAABFAAAABwAAAAAAAAAAAAAACQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZnZq5EBmZmZmhunzQJmZmZnRnf1AZmZmZg6pA0EAAAAANIMIQZmZmZlZXQ1BmZmZmb8bEUFmZmZm0ogTQTMzMzPl9RVBAAAAAPhiGEE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAeoEBmZmZmdmrkQGZmZmaG6fNAmZmZmdGd/UBmZmZmDqkDQQAAAAA0gwhBmZmZmVldDUGZmZmZvxsRQWZmZmbSiBNBMzMzM+X1FUE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"IAEAAOwBAAC3AAAARAAAAB4AAAAOAAAAAgAAAAEAAAABAAAABAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"ZmZmZnZq5EBmZmZmhunzQJmZmZnRnf1AZmZmZg6pA0EAAAAANIMIQZmZmZlZXQ1BmZmZmb8bEUFmZmZm0ogTQTMzMzPl9RVBAAAAAPhiGEE=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: MORTDUE\\\"}]}\"]]}],[\"LOAN\",{\"type\":\"map\",\"entries\":[[\"header\",\"{\\\"msgid\\\": \\\"p1195\\\", \\\"msgtype\\\": \\\"PATCH-DOC\\\"}\"],[\"metadata\",\"{\\\"use_buffers\\\": false}\"],[\"content\",\"{\\\"events\\\":[{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1019\\\"},\\\"attr\\\":\\\"hold_render\\\",\\\"new\\\":false},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1050\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"agQAAJcJAAAwBgAAowEAALgAAAByAAAAEgAAABoAAAANAAAAEQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1065\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"KAMAAL8HAAA3BQAAaQEAAIcAAABVAAAADwAAABgAAAAIAAAAEQAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ColumnDataChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1079\\\"},\\\"attr\\\":\\\"data\\\",\\\"data\\\":{\\\"type\\\":\\\"map\\\",\\\"entries\\\":[[\\\"left\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAAwkUAAAAAAAH7DQAAAAAAAa9JAAAAAAAAX20AAAAAAgOHhQAAAAACAN+ZAAAAAAICN6kAAAAAAgOPuQAAAAADAnPFAAAAAAMDH80A=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}],[\\\"top\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"QgEAANgBAAD5AAAAOgAAADEAAAAdAAAAAwAAAAIAAAAFAAAAAAAAAA==\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"int32\\\",\\\"order\\\":\\\"little\\\"}],[\\\"right\\\",{\\\"type\\\":\\\"ndarray\\\",\\\"array\\\":{\\\"type\\\":\\\"bytes\\\",\\\"data\\\":\\\"AAAAAAB+w0AAAAAAAGvSQAAAAAAAF9tAAAAAAIDh4UAAAAAAgDfmQAAAAACAjepAAAAAAIDj7kAAAAAAwJzxQAAAAADAx/NAAAAAAMDy9UA=\\\"},\\\"shape\\\":[10],\\\"dtype\\\":\\\"float64\\\",\\\"order\\\":\\\"little\\\"}]]},\\\"cols\\\":[\\\"left\\\",\\\"top\\\",\\\"right\\\"]},{\\\"kind\\\":\\\"ModelChanged\\\",\\\"model\\\":{\\\"id\\\":\\\"p1022\\\"},\\\"attr\\\":\\\"text\\\",\\\"new\\\":\\\"Variable: LOAN\\\"}]}\"]]}]]},\"widgets\":{\"type\":\"map\",\"entries\":[[\"p1098\",0]]},\"values\":[\"LOAN\"]}}],\"defs\":[{\"type\":\"model\",\"name\":\"ReactiveHTML1\"},{\"type\":\"model\",\"name\":\"FlexBox1\",\"properties\":[{\"name\":\"align_content\",\"kind\":\"Any\",\"default\":\"flex-start\"},{\"name\":\"align_items\",\"kind\":\"Any\",\"default\":\"flex-start\"},{\"name\":\"flex_direction\",\"kind\":\"Any\",\"default\":\"row\"},{\"name\":\"flex_wrap\",\"kind\":\"Any\",\"default\":\"wrap\"},{\"name\":\"gap\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"justify_content\",\"kind\":\"Any\",\"default\":\"flex-start\"}]},{\"type\":\"model\",\"name\":\"FloatPanel1\",\"properties\":[{\"name\":\"config\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"contained\",\"kind\":\"Any\",\"default\":true},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"right-top\"},{\"name\":\"offsetx\",\"kind\":\"Any\",\"default\":null},{\"name\":\"offsety\",\"kind\":\"Any\",\"default\":null},{\"name\":\"theme\",\"kind\":\"Any\",\"default\":\"primary\"},{\"name\":\"status\",\"kind\":\"Any\",\"default\":\"normalized\"}]},{\"type\":\"model\",\"name\":\"GridStack1\",\"properties\":[{\"name\":\"mode\",\"kind\":\"Any\",\"default\":\"warn\"},{\"name\":\"ncols\",\"kind\":\"Any\",\"default\":null},{\"name\":\"nrows\",\"kind\":\"Any\",\"default\":null},{\"name\":\"allow_resize\",\"kind\":\"Any\",\"default\":true},{\"name\":\"allow_drag\",\"kind\":\"Any\",\"default\":true},{\"name\":\"state\",\"kind\":\"Any\",\"default\":[]}]},{\"type\":\"model\",\"name\":\"drag1\",\"properties\":[{\"name\":\"slider_width\",\"kind\":\"Any\",\"default\":5},{\"name\":\"slider_color\",\"kind\":\"Any\",\"default\":\"black\"},{\"name\":\"value\",\"kind\":\"Any\",\"default\":50}]},{\"type\":\"model\",\"name\":\"click1\",\"properties\":[{\"name\":\"terminal_output\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"debug_name\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"clears\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"FastWrapper1\",\"properties\":[{\"name\":\"object\",\"kind\":\"Any\",\"default\":null},{\"name\":\"style\",\"kind\":\"Any\",\"default\":null}]},{\"type\":\"model\",\"name\":\"NotificationAreaBase1\",\"properties\":[{\"name\":\"js_events\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"bottom-right\"},{\"name\":\"_clear\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"NotificationArea1\",\"properties\":[{\"name\":\"js_events\",\"kind\":\"Any\",\"default\":{\"type\":\"map\"}},{\"name\":\"notifications\",\"kind\":\"Any\",\"default\":[]},{\"name\":\"position\",\"kind\":\"Any\",\"default\":\"bottom-right\"},{\"name\":\"_clear\",\"kind\":\"Any\",\"default\":0},{\"name\":\"types\",\"kind\":\"Any\",\"default\":[{\"type\":\"map\",\"entries\":[[\"type\",\"warning\"],[\"background\",\"#ffc107\"],[\"icon\",{\"type\":\"map\",\"entries\":[[\"className\",\"fas fa-exclamation-triangle\"],[\"tagName\",\"i\"],[\"color\",\"white\"]]}]]},{\"type\":\"map\",\"entries\":[[\"type\",\"info\"],[\"background\",\"#007bff\"],[\"icon\",{\"type\":\"map\",\"entries\":[[\"className\",\"fas fa-info-circle\"],[\"tagName\",\"i\"],[\"color\",\"white\"]]}]]}]}]},{\"type\":\"model\",\"name\":\"Notification\",\"properties\":[{\"name\":\"background\",\"kind\":\"Any\",\"default\":null},{\"name\":\"duration\",\"kind\":\"Any\",\"default\":3000},{\"name\":\"icon\",\"kind\":\"Any\",\"default\":null},{\"name\":\"message\",\"kind\":\"Any\",\"default\":\"\"},{\"name\":\"notification_type\",\"kind\":\"Any\",\"default\":null},{\"name\":\"_destroyed\",\"kind\":\"Any\",\"default\":false}]},{\"type\":\"model\",\"name\":\"TemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"BootstrapTemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"TemplateEditor1\",\"properties\":[{\"name\":\"layout\",\"kind\":\"Any\",\"default\":[]}]},{\"type\":\"model\",\"name\":\"MaterialTemplateActions1\",\"properties\":[{\"name\":\"open_modal\",\"kind\":\"Any\",\"default\":0},{\"name\":\"close_modal\",\"kind\":\"Any\",\"default\":0}]},{\"type\":\"model\",\"name\":\"copy_to_clipboard1\",\"properties\":[{\"name\":\"fill\",\"kind\":\"Any\",\"default\":\"none\"},{\"name\":\"value\",\"kind\":\"Any\",\"default\":null}]}]}};\n",
       "  var render_items = [{\"docid\":\"62c794f4-24ad-4dfa-b836-d731f0955427\",\"roots\":{\"p1004\":\"cb3b968a-d8e8-469d-933b-17956028b140\"},\"root_ids\":[\"p1004\"]}];\n",
       "  var docs = Object.values(docs_json)\n",
       "  if (!docs) {\n",
       "    return\n",
       "  }\n",
       "  const py_version = docs[0].version.replace('rc', '-rc.').replace('.dev', '-dev.')\n",
       "  async function embed_document(root) {\n",
       "    var Bokeh = get_bokeh(root)\n",
       "    await Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "    for (const render_item of render_items) {\n",
       "      for (const root_id of render_item.root_ids) {\n",
       "\tconst id_el = document.getElementById(root_id)\n",
       "\tif (id_el.children.length && id_el.children[0].hasAttribute('data-root-id')) {\n",
       "\t  const root_el = id_el.children[0]\n",
       "\t  root_el.id = root_el.id + '-rendered'\n",
       "\t  for (const child of root_el.children) {\n",
       "            // Ensure JupyterLab does not capture keyboard shortcuts\n",
       "            // see: https://jupyterlab.readthedocs.io/en/4.1.x/extension/notebook.html#keyboard-interaction-model\n",
       "\t    child.setAttribute('data-lm-suppress-shortcuts', 'true')\n",
       "\t  }\n",
       "\t}\n",
       "      }\n",
       "    }\n",
       "  }\n",
       "  function get_bokeh(root) {\n",
       "    if (root.Bokeh === undefined) {\n",
       "      return null\n",
       "    } else if (root.Bokeh.version !== py_version) {\n",
       "      if (root.Bokeh.versions === undefined || !root.Bokeh.versions.has(py_version)) {\n",
       "\treturn null\n",
       "      }\n",
       "      return root.Bokeh.versions.get(py_version);\n",
       "    } else if (root.Bokeh.version === py_version) {\n",
       "      return root.Bokeh\n",
       "    }\n",
       "    return null\n",
       "  }\n",
       "  function is_loaded(root) {\n",
       "    var Bokeh = get_bokeh(root)\n",
       "    return (Bokeh != null && Bokeh.Panel !== undefined)\n",
       "  }\n",
       "  if (is_loaded(root)) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (is_loaded(root)) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else if (document.readyState == \"complete\") {\n",
       "        attempts++;\n",
       "        if (attempts > 200) {\n",
       "          clearInterval(timer);\n",
       "\t  var Bokeh = get_bokeh(root)\n",
       "\t  if (Bokeh == null || Bokeh.Panel == null) {\n",
       "            console.warn(\"Panel: ERROR: Unable to run Panel code because Bokeh or Panel library is missing\");\n",
       "\t  } else {\n",
       "\t    console.warn(\"Panel: WARNING: Attempting to render but not all required libraries could be resolved.\")\n",
       "\t    embed_document(root)\n",
       "\t  }\n",
       "        }\n",
       "      }\n",
       "    }, 25, root)\n",
       "  }\n",
       "})(window);</script>"
      ],
      "text/plain": [
       ":HoloMap   [var]\n",
       "   :Overlay\n",
       "      .Histogram.ALL_Loans     :Histogram   [x]   (Frequency)\n",
       "      .Histogram.PAID_Loans    :Histogram   [x]   (Frequency)\n",
       "      .Histogram.DEFAULT_Loans :Histogram   [x]   (Frequency)"
      ]
     },
     "execution_count": 4,
     "metadata": {
      "application/vnd.holoviews_exec.v0+json": {
       "id": "p1004"
      }
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# %%opts Histogram[width=700 height=400 tools=['hover'] xrotation=0]{+axiswise +framewise}\n",
    "\n",
    "g = df.groupby('STATUS')\n",
    "\n",
    "cols = ['LOAN',\n",
    "        'MORTDUE', \n",
    "        'VALUE',\n",
    "        'YOJ',\n",
    "        'DEROG',\n",
    "        'DELINQ',\n",
    "        'CLAGE',\n",
    "        'NINQ',\n",
    "        'CLNO']\n",
    "dd={}\n",
    "\n",
    "# Histograms\n",
    "for col in cols:\n",
    "    \n",
    "    # fix --- np.histogram cannot compute a valid range for nan values\n",
    "#     freq, edges = np.histogram(df[col].values)\n",
    "    values = df[col].dropna().values\n",
    "    if len(values) == 0:\n",
    "        print(f\"Skipping column '{col}' – all values are NaN\")\n",
    "        continue\n",
    "        \n",
    "    freq, edges = np.histogram(values)\n",
    "    \n",
    "    \n",
    "    dd[col] = hv.Histogram((edges, freq), label='ALL Loans').redim.label(x=' ')\n",
    "    \n",
    "    freq, edges = np.histogram(g.get_group('PAID')[col].values, bins=edges)\n",
    "    dd[col] *= hv.Histogram((edges, freq), label='PAID Loans').redim.label(x=' ')\n",
    "    \n",
    "    freq, edges = np.histogram(g.get_group('DEFAULT')[col].values, bins=edges)\n",
    "    dd[col] *= hv.Histogram((edges, freq), label='DEFAULT Loans' ).redim.label(x=' ')   \n",
    "    \n",
    "var = [*dd]\n",
    "kdims=hv.Dimension(('var', 'Variable'), values=var)    \n",
    "hv.HoloMap(dd, kdims=kdims)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "bba53af90d733c7a8593cbe8e76538dce6a013e0"
   },
   "outputs": [],
   "source": [
    "%%opts Scatter[width=500 height=500 tools=['hover'] xrotation=0]{+axiswise +framewise}\n",
    "\n",
    "g = df.groupby('STATUS')\n",
    "\n",
    "cols = ['LOAN',\n",
    "        'MORTDUE',\n",
    "        'VALUE',\n",
    "        'YOJ',\n",
    "        'DEROG',\n",
    "        'DELINQ',\n",
    "        'CLAGE',\n",
    "        'NINQ',\n",
    "        'CLNO']\n",
    "\n",
    "import itertools\n",
    "prod = list(itertools.combinations(cols,2))\n",
    "\n",
    "dd = {}\n",
    "\n",
    "for p in prod:\n",
    "    dd['_'.join(p)] = hv.Scatter(g.get_group('PAID')[list(p)], label='PAID Loans').options(size=5)\n",
    "    dd['_'.join(p)] *= hv.Scatter(g.get_group('DEFAULT')[list(p)], label='DEFAULT Loans').options(size=5, marker='x')\n",
    "    \n",
    "var = [*dd]\n",
    "kdims=hv.Dimension(('var', 'Variable'), values=var)    \n",
    "hv.HoloMap(dd, kdims=kdims).collate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "48f49cd93a8b662849f10842b907eaff97c61213"
   },
   "outputs": [],
   "source": [
    "g=sns.PairGrid(df.drop('BAD',axis=1), hue='STATUS', diag_sharey=False, palette={'PAID': 'C0', 'DEFAULT':'C1'})\n",
    "g.map_lower(sns.kdeplot)\n",
    "g.map_upper(sns.scatterplot)\n",
    "g.map_diag(sns.kdeplot, lw=3)\n",
    "g.add_legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "7351e8abefcfcf52ffb2da6d4dc11de6c9147f5f"
   },
   "source": [
    "### Violin plot\n",
    "<a id='violin'></a>\n",
    "Violin plot shows the different shapes of the probability density function for some of the variables discussed previously that seem the most promising for the classification task. The plot shows, in different colors, the PAID and the DEFAULT loans. The horizontal dashed lines indecate the position of the mean and the quantiles of the different distributions. Since there is a dependency of the DEFAULT probability on the occupation categories, the \"violins\" are shown for each of them."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "c3f2d2b3a9d2d10120b9655b3b7b6fc6158bd20b"
   },
   "outputs": [],
   "source": [
    "cols=['YOJ', 'CLAGE', 'NINQ']\n",
    "\n",
    "for col in cols:\n",
    "    \n",
    "    plt.figure(figsize=(15,5))\n",
    "\n",
    "    sns.violinplot(x='JOB', y=col, hue='STATUS',\n",
    "                   split=True, inner=\"quart\",  palette={'PAID': 'C0', 'DEFAULT':'C1'},\n",
    "                   data=df)\n",
    "    \n",
    "    sns.despine(left=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "8204474b9c4bf0681597d41b6f7a84733854ec27"
   },
   "source": [
    "### Correlation matrix\n",
    "<a id='corr'></a>\n",
    "Finally I show the correlation matrix among the variables discussed so far. Correlations are useful because they can indicate a predictive relationship that can be exploited in the classification task. \n",
    "\n",
    "The plot is color coded: colder colors correspond to low correlation while warmer color correspond to high correlation. The variables are also grouped according to their correlation, i.e. variables with higher correlation are close to each other.\n",
    "\n",
    "Variables related to the credit history (DELINQ, DEROG, NINQ) are the most correlated with the loan status (BAD), suggesting that these will be the most discriminating variables. These variables are also slightly correlated among them, suggesting that some of the information might be redoundant.\n",
    "\n",
    "As already discussed, the amount of the loan or the underlying collateral do not seem related to the loan status. They anyhow form another correlation cluster with other variables such as the age of oldest credit line (CLAGE) and the number of credit lines (CLNO). This is expected since those variables are clearly related."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "62dcf0c50169195a204178098de9043005fc9b4d"
   },
   "outputs": [],
   "source": [
    "def compute_corr(df,size=10):\n",
    "    '''Function plots a graphical correlation matrix for each pair of columns in the dataframe.\n",
    "\n",
    "    Input:\n",
    "        df: pandas DataFrame\n",
    "        size: vertical and horizontal size of the plot'''\n",
    "    import scipy\n",
    "    import scipy.cluster.hierarchy as sch\n",
    "    \n",
    "    corr = df.corr()\n",
    "    \n",
    "    # Clustering\n",
    "    d = sch.distance.pdist(corr)   # vector of ('55' choose 2) pairwise distances\n",
    "    L = sch.linkage(d, method='complete')\n",
    "    ind = sch.fcluster(L, 0.5*d.max(), 'distance')\n",
    "    columns = [df.select_dtypes(include=[np.number]).columns.tolist()[i] for i in list((np.argsort(ind)))]\n",
    "    \n",
    "    # Reordered df upon custering results\n",
    "    df = df.reindex(columns, axis=1)\n",
    "    \n",
    "    # Recompute correlation matrix w/ clustering\n",
    "    corr = df.corr()\n",
    "    #corr.dropna(axis=0, how='all', inplace=True)\n",
    "    #corr.dropna(axis=1, how='all', inplace=True)\n",
    "    #corr.fillna(0, inplace=True)\n",
    "    \n",
    "    #fig, ax = plt.subplots(figsize=(size, size))\n",
    "    #img = ax.matshow(corr)\n",
    "    #plt.xticks(range(len(corr.columns)), corr.columns, rotation=45);\n",
    "    #plt.yticks(range(len(corr.columns)), corr.columns);\n",
    "    #fig.colorbar(img)\n",
    "    \n",
    "    return corr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "d5e9979ed5d368f2c877b2ac70c13d709e6ae9e2"
   },
   "outputs": [],
   "source": [
    "%%opts HeatMap [tools=['hover'] colorbar=True width=500  height=500 toolbar='above', xrotation=45, yrotation=45]\n",
    "\n",
    "corr=compute_corr(df)\n",
    "corr=corr.stack(level=0).to_frame('value').reset_index()\n",
    "hv.HeatMap(corr).options(cmap='Viridis')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "b5e8db9cd86ea60f3b63cfe9a0c758ad611a138f"
   },
   "source": [
    "<a id='classification'></a>\n",
    "# Test of default classifiers\n",
    "The exploratory analysis described above provides good insights on the dataset and higlights the most promising variables with good discrimination power to identify loans resulting in DEFAULT. In this section I develop and investigate supervided machine learning classifiers to predict the outcome of loans. Given the large amount of algorithms available in literature, I begin from the simple methods, such as logistc regression, and gradually increase the model complexity up to randomized trees techniques. Finally I compare the performance of each model and discuss the most appropriate for this loan classification task. In this section, the following models are developed:\n",
    "* [Logistic regression](#logit)\n",
    "* [SGD classifier](#sgd)\n",
    "* [Supporting vector classifier](#svc)\n",
    "* [Gradient boosting classifier](#gbrt)\n",
    "* [Forest of randomized tree](#frt)\n",
    "    * [Randm forest classifier](#rfc)\n",
    "    * [Extremely randomized tree](#ert)\n",
    "* [Model comparison and conclusion](#conclusion)\n",
    "\n",
    "<a id='eval'></a>\n",
    "## Model Evaluation\n",
    "The evaluation of classifiers performance is relatively complex and depenends on many factors, some of which are model dependent. In order to indetify the best model for our classification task, I adopt different evaluation metrics that are briefly summarized in the following.\n",
    "\n",
    "To avoid overtraining, the performance of our classification model are evaluated using cross-validation. The training set is randomly splited in $N$ distinct subsets called folds, then the model is trained and evaluated $N$ times by using a different fold for the evaluation of a model that is trained on the other $N-1$ folds. The results of the procedure consist in $N$ evaluation scores for each metric that are then averaged. These averages are fianlly used to compare the different techniques considered in this study.\n",
    "\n",
    "<a id='per'></a>\n",
    "### Precision & recall\n",
    "Precision-Recall is a useful performance metric to evaluate a models in those cases when the classes are very imbalanced. In information retrieval, precision is a measure of result relevancy, while recall is a measure of how many truly relevant results are returned. Intuitively, precision is the ability of the classifier not to label as positive a sample that is negative, and recall is the ability of the classifier to find all the positive samples. \n",
    "\n",
    "A system with high recall but low precision returns many labels that tend to be predicted incorrectly when compared to the training labels. A system with high precision but low recall is just the opposite, returning very few results, but most of its predicted labels are correct when compared to the training labels. An ideal system with high precision and high recall will return many results, with many results labeled correctly.\n",
    "\n",
    "Precision ($P$) is defined as the number of true positives ($T_{p}$) over the number of true positives plus the number of false positives ($T_{p}+F_{p}$):\n",
    "\n",
    "$P = \\frac{T_{p}}{T_{p}+F_{p}}$  \n",
    "\n",
    "Recall ($R$) is defined as the number of true positives ($T_{p}$) over the number of true positives plus the number of false negatives ($T_{p}+F_{n}$):\n",
    "\n",
    "$R = \\frac{T_{p}}{T_{p}+F_{n}}$\n",
    "\n",
    "<a id='f1'></a>\n",
    "### F1 measure\n",
    "It is often convenient to combine precision and recall into a single metric called the $F_{1}$ score, defined as a weighted harmonic mean of the precision and recall:\n",
    "\n",
    "$F_{1} = 2\\times \\frac{P \\times R}{P+R}$\n",
    "\n",
    "Whereas the regular mean treats all values equally, the harmonic mean gives much more weight to low values. As a result, the classifier will only get a high F1 score if both recall and precision are high.\n",
    "The $F_{1}$ score favors classifiers that have similar precision and recall. This is not always what you want: in some contexts you mostly care about precision, and in other contexts you really care about recall.\n",
    "\n",
    "<a id='roc'></a>\n",
    "###  Receiver operating characteristic\n",
    "A receiver operating characteristic (ROC), or simply ROC curve, is a graphical plot which illustrates the performance of a binary classifier system as its discrimination threshold is varied. It is created by plotting the fraction of true positives out of the positives (TPR = true positive rate) vs. the fraction of false positives out of the negatives (FPR = false positive rate), at various threshold settings. TPR is also known as sensitivity, and FPR is one minus the specificity or true negative rate.\n",
    "There is a tradeoff: the higher the recall (TPR), the more false positives (FPR) the classifier produces. The dotted line represents the ROC curve of a purely random classifier; a good classifier stays as far away from that line as possible (toward the top-left corner). \n",
    "\n",
    "The area under the ROC curve, which is also denoted by AUC, summarise the curve information in one number. The AUC should be interpreted as the probability that a classifier will rank a randomly chosen positive istance higher than a randomly chosen negative one. A perfect classifier will have a ROC AUC equal to 1, whereas a purely random classifier will have a ROC AUC equal to 0.5.\n",
    "\n",
    "<a id='confusion'></a>\n",
    "### Confusion matrix\n",
    "The confusion matrix evaluates classification accuracy by computing the confusion matrix with each row corresponding to the true class. By definition, entry $i,j$ in a confusion matrix is the number of observations actually in group $i$, but predicted to be in group $j$. The confusion matrix is not used for model evaluation but it provide a good grasp on the overall model performance.\n",
    "\n",
    "<a id='prob'></a>\n",
    "### Classification probability\n",
    "The classification probability provides an estimation of the probability that a given instance of the data belongs to the given class. In a binary classification problem like the one being considered, the histogram of the classification probability for the two class provide a good visual grasp on the model performance. The more the peak of the classification probability are far from each other, the higher the separation power of the model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "5ce7c5a234213bbcaa3ece610a34ec4ebf437b35"
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pprint import pprint\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.model_selection import cross_val_score\n",
    "from sklearn.model_selection import cross_validate\n",
    "from sklearn.metrics import classification_report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "c5efc75e35bcb100cfb18af07653ebb4e2640b04"
   },
   "outputs": [],
   "source": [
    "df=pd.read_csv('../input/hmeq.csv', low_memory=False) # No duplicated columns, no highly correlated columns\n",
    "df=pd.get_dummies(df, columns=['REASON','JOB'])\n",
    "df.drop('DEBTINC', axis=1, inplace=True)\n",
    "df.dropna(axis=0, how='any', inplace=True)\n",
    "y = df['BAD']\n",
    "X = df.drop(['BAD'], axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "ac954ae9704fb17b42b548fb0ade5e91ca917c3c"
   },
   "outputs": [],
   "source": [
    "def cross_validate_model(model, X, y, \n",
    "                         scoring=['f1', 'precision', 'recall', 'roc_auc'], \n",
    "                         cv=12, n_jobs=-1, verbose=True):\n",
    "    \n",
    "    scores = cross_validate(pipe, \n",
    "                        X, y, \n",
    "                        scoring=scoring,\n",
    "                        cv=cv, n_jobs=n_jobs, \n",
    "                        verbose=verbose,\n",
    "                        return_train_score=False)\n",
    "\n",
    "    #sorted(scores.keys())\n",
    "    dd={}\n",
    "    \n",
    "    for key, val in scores.items():\n",
    "        if key in ['fit_time', 'score_time']:\n",
    "            continue\n",
    "        #print('{:>30}: {:>6.5f} +/- {:.5f}'.format(key, np.mean(val), np.std(val)) )\n",
    "        name = \" \".join(key.split('_')[1:]).capitalize()\n",
    "        \n",
    "        dd[name] = {'value' : np.mean(val), 'error' : np.std(val)}\n",
    "        \n",
    "    return  pd.DataFrame(dd)    \n",
    "    #print()\n",
    "    #pprint(scores)\n",
    "    #print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "8bc2942ce77db1e02bb570bd7613afaba51a75bb"
   },
   "outputs": [],
   "source": [
    "def plot_roc(model, X_test ,y_test, n_classes=0):\n",
    "    \n",
    "    from sklearn.metrics import roc_curve, auc\n",
    "    \n",
    "    \"\"\"\n",
    "    Target scores, can either be probability estimates \n",
    "    of the positive class, confidence values, or \n",
    "    non-thresholded measure of decisions (as returned \n",
    "    by “decision_function” on some classifiers).\n",
    "    \"\"\"\n",
    "    try:\n",
    "        y_score = model.decision_function(X_test)\n",
    "    except Exception as e:\n",
    "        y_score = model.predict_proba(X_test)[:,1]\n",
    "    \n",
    "    \n",
    "    fpr, tpr, _ = roc_curve(y_test.ravel(), y_score.ravel())\n",
    "    roc_auc = auc(fpr, tpr)\n",
    "\n",
    "    # Compute micro-average ROC curve and ROC area\n",
    "    #fpr[\"micro\"], tpr[\"micro\"], _ = roc_curve(y_test.ravel(), y_score.ravel())\n",
    "    #roc_auc[\"micro\"] = auc(fpr[\"micro\"], tpr[\"micro\"])\n",
    "    \n",
    "    #plt.figure()\n",
    "    lw = 2\n",
    "    plt.plot(fpr, tpr, color='darkorange',\n",
    "             lw=lw, label='ROC curve (area = %0.2f)' % roc_auc)\n",
    "\n",
    "    plt.plot([0, 1], [0, 1], color='navy', lw=lw, linestyle='--')\n",
    "    plt.xlim([0.0, 1.0])\n",
    "    plt.ylim([0.0, 1.05])\n",
    "    plt.xlabel('False Positive Rate')\n",
    "    plt.ylabel('True Positive Rate')\n",
    "    plt.title('Receiver operating characteristic example')\n",
    "    plt.legend(loc=\"lower right\")\n",
    "    #plt.show()\n",
    "    \n",
    "# shuffle and split training and test sets\n",
    "#X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5,\n",
    "#                                                    random_state=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "c321fe50f6eb4498dd30597623f996803dc741aa"
   },
   "outputs": [],
   "source": [
    "def plot_confusion_matrix(model, X_test ,y_test,\n",
    "                          classes=[0,1],\n",
    "                          normalize=False,\n",
    "                          title='Confusion matrix',\n",
    "                          cmap=plt.cm.Blues):\n",
    "    \n",
    "    import itertools\n",
    "    from sklearn.metrics import confusion_matrix\n",
    "    \n",
    "    y_pred = model.predict(X_test)\n",
    "    \n",
    "    # Compute confusion matrix\n",
    "    cm = confusion_matrix(y_test, y_pred)\n",
    "    np.set_printoptions(precision=2)\n",
    "    \n",
    "    \"\"\"\n",
    "    This function prints and plots the confusion matrix.\n",
    "    Normalization can be applied by setting `normalize=True`.\n",
    "    \"\"\"\n",
    "    if normalize:\n",
    "        cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]\n",
    "    #    print(\"Normalized confusion matrix\")\n",
    "    #else:\n",
    "    #    print('Confusion matrix, without normalization')\n",
    "\n",
    "    #print(cm)\n",
    "\n",
    "    plt.imshow(cm, interpolation='nearest', cmap=cmap)\n",
    "    plt.title(title)\n",
    "    plt.colorbar()\n",
    "    tick_marks = np.arange(len(classes))\n",
    "    plt.xticks(tick_marks, classes, rotation=45)\n",
    "    plt.yticks(tick_marks, classes)\n",
    "\n",
    "    fmt = '.2f' if normalize else 'd'\n",
    "    thresh = cm.max() / 2.\n",
    "    for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):\n",
    "        plt.text(j, i, format(cm[i, j], fmt),\n",
    "                 horizontalalignment=\"center\",\n",
    "                 color=\"white\" if cm[i, j] > thresh else \"black\")\n",
    "\n",
    "    plt.tight_layout()\n",
    "    plt.ylabel('True label')\n",
    "    plt.xlabel('Predicted label')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "8395e8a2f03ef68d865d6a58dfa8924c143448b6"
   },
   "outputs": [],
   "source": [
    "def feature_importance(coef, names, verbose=False, plot=True):\n",
    "    \n",
    "    #importances = model.feature_importances_\n",
    "\n",
    "    \n",
    "    \n",
    "    #std = np.std([tree.feature_importances_ for tree in model.estimators_],\n",
    "    #             axis=0)\n",
    "    indices = np.argsort(coef)[::-1]\n",
    "    \n",
    "    if verbose:\n",
    "    \n",
    "        # Print the feature ranking\n",
    "        print(\"Feature ranking:\")\n",
    "    \n",
    "        for f in range(len(names)):\n",
    "            print(\"{:>2d}. {:>15}: {:.5f}\".format(f + 1, names[indices[f]], coef[indices[f]]))\n",
    "        \n",
    "    if plot:\n",
    "        \n",
    "        # Plot the feature importances of the forest\n",
    "        #plt.figure(figsize=(5,10))\n",
    "        plt.title(\"Feature importances\")\n",
    "        plt.barh(range(len(names)), coef[indices][::-1], align=\"center\")\n",
    "        #plt.barh(range(X.shape[1]), importances[indices][::-1],\n",
    "        #         xerr=std[indices][::-1], align=\"center\")\n",
    "        plt.yticks(range(len(names)), names[indices][::-1])\n",
    "        #plt.xlim([-0.001, 1.1])\n",
    "        #plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "4b82915abe9c07f603d19a0a4bdd2cd4279cbdd8"
   },
   "outputs": [],
   "source": [
    "def plot_proba(model, X, y, bins=40, show_class = 1):\n",
    "    \n",
    "    from sklearn.calibration import CalibratedClassifierCV\n",
    "    \n",
    "    model = CalibratedClassifierCV(model)#, cv='prefit')\n",
    "    \n",
    "    model.fit(X, y)\n",
    "    \n",
    "    proba=model.predict_proba(X)\n",
    "    \n",
    "    if show_class == 0:\n",
    "        sns.kdeplot(proba[y==0,0], shade=True, color=\"r\", label='True class')\n",
    "        sns.kdeplot(proba[y==0,1], shade=True, color=\"b\", label='Wrong class')\n",
    "        plt.title('Classification probability: Class 0')\n",
    "    elif show_class == 1:\n",
    "        sns.kdeplot(proba[y==1,1], shade=True, color=\"r\", label='True class')\n",
    "        sns.kdeplot(proba[y==1,0], shade=True, color=\"b\", label='Wrong class')\n",
    "        plt.title('Classification probability: Class 1')\n",
    "    plt.legend()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "e940ba20f513b744d2fa5132d7c14206b7901680"
   },
   "source": [
    "## Logistic regression\n",
    "<a id='logit'></a>\n",
    "\n",
    "Logistic regression is the simplest linear model for classification. Logistic regression is also known in the literature as logit regression, maximum-entropy classification (MaxEnt) or the log-linear classifier. In this model, the probabilities describing the possible outcomes of a single trial are modeled using a logistic function. The optimization problem is solved minimizing a cost function using an highly optimized coordinate descent algorithm."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "d526e2619034ae819155db168a52baa4db11545e"
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "steps = [('scaler', StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
    "         ('model', LogisticRegression(random_state=0))]\n",
    "\n",
    "pipe = Pipeline(steps)\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2, random_state=0)\n",
    "pipe.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "1238203218684c84f0435627e32531a58af94807"
   },
   "outputs": [],
   "source": [
    "plt.figure(figsize=(15,10))\n",
    "\n",
    "plt.subplot(221)\n",
    "plot_roc(pipe, X_test ,y_test)\n",
    "\n",
    "plt.subplot(222)\n",
    "plot_confusion_matrix(pipe, X_test ,y_test, normalize=True)\n",
    "\n",
    "plt.subplot(223)\n",
    "plot_proba(pipe, X_test, y_test)\n",
    "\n",
    "plt.subplot(224)\n",
    "feature_importance(pipe.named_steps['model'].coef_[0], X.columns)\n",
    "\n",
    "plt.tight_layout()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "9b7e4bdcf812f7851e5022ad91c9645cbad26ba3"
   },
   "outputs": [],
   "source": [
    "logit_xval_res = cross_validate_model(pipe, X, y, verbose=False)\n",
    "logit_xval_res.T[['value','error']].style.format(\"{:.2f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "2a57986faf29fb12dfe52cf38e48588a85f1329e"
   },
   "source": [
    "<a id='frt'></a>\n",
    "### Forests of randomized trees\n",
    "Decision Trees (DTs) are a non-parametric supervised learning method used for classification and regression. The goal is to create a model that predicts the value of a target variable by learning simple decision rules inferred from the data features.\n",
    "\n",
    "The forest of randomized tree technique includes two averaging algorithms based on randomized decision trees: the RandomForest algorithm and the Extra-Trees method. Both algorithms are perturb-and-combine techniques specifically designed for trees. This means a diverse set of classifiers is created by introducing randomness in the classifier construction. The prediction of the ensemble is given as the averaged prediction of the individual classifiers.\n",
    "\n",
    "<a id='rfc'></a>\n",
    "#### Random Forest Classifier\n",
    "In random forests, each tree in the ensemble is built from a sample drawn with replacement (i.e., a bootstrap sample) from the training set. In addition, when splitting a node during the construction of the tree, the split that is chosen is no longer the best split among all features. Instead, the split that is picked is the best split among a random subset of the features. As a result of this randomness, the bias of the forest usually slightly increases (with respect to the bias of a single non-random tree) but, due to averaging, its variance also decreases, usually more than compensating for the increase in bias, hence yielding an overall better model."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "6f98e2f06aea23bbcd54a7d110ada03a5b4f1d24",
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
    "\n",
    "steps = [('scaler', StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
    "         ('model', RandomForestClassifier(n_estimators=250, n_jobs=-1, random_state=0))]\n",
    "\n",
    "pipe = Pipeline(steps)\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2, random_state=0)\n",
    "pipe.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "bdb13c15335b04789b591de91dd606a57ac755a9"
   },
   "outputs": [],
   "source": [
    "plt.figure(figsize=(15,10))\n",
    "\n",
    "plt.subplot(221)\n",
    "plot_roc(pipe, X_test ,y_test)\n",
    "\n",
    "plt.subplot(222)\n",
    "plot_confusion_matrix(pipe, X_test ,y_test, normalize=True)\n",
    "\n",
    "plt.subplot(223)\n",
    "plot_proba(pipe, X_test, y_test)\n",
    "\n",
    "plt.subplot(224)\n",
    "feature_importance(pipe.named_steps['model'].feature_importances_, X.columns)\n",
    "\n",
    "plt.tight_layout()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "4bb62c9ba333c45f9d6e58a28c4e6a27c0d0e8ff"
   },
   "outputs": [],
   "source": [
    "rfc_xval_res = cross_validate_model(pipe, X, y, verbose=False)\n",
    "rfc_xval_res.T[['value','error']].style.format(\"{:.2f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "32fac0f2dc0970d4c7b60cb02229b97df5897bc1"
   },
   "source": [
    "<a id='ert'></a>\n",
    "#### Extremely Randomized Trees\n",
    "In extremely randomized trees, randomness goes one step further in the way splits are computed. As in random forests, a random subset of candidate features is used, but instead of looking for the most discriminative thresholds, thresholds are drawn at random for each candidate feature and the best of these randomly-generated thresholds is picked as the splitting rule. This usually allows to reduce the variance of the model a bit more, at the expense of a slightly greater increase in bias"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "687c336968c42abd165a735641f5cfbd9de03be9"
   },
   "outputs": [],
   "source": [
    "from sklearn.ensemble import ExtraTreesClassifier\n",
    "\n",
    "steps = [('scaler', StandardScaler(copy=True, with_mean=True, with_std=True)),\n",
    "         ('model', ExtraTreesClassifier(n_estimators=250, n_jobs=-1, random_state=0, class_weight='balanced'))]\n",
    "\n",
    "pipe = Pipeline(steps)\n",
    "\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.2, random_state=0)\n",
    "pipe.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "97a8c723c30fdcdf7d040989c5094d7c762ba85b"
   },
   "outputs": [],
   "source": [
    "plt.figure(figsize=(15,10))\n",
    "\n",
    "plt.subplot(221)\n",
    "plot_roc(pipe, X_test ,y_test)\n",
    "\n",
    "plt.subplot(222)\n",
    "plot_confusion_matrix(pipe, X_test ,y_test, normalize=True)\n",
    "\n",
    "plt.subplot(223)\n",
    "plot_proba(pipe, X_test, y_test)\n",
    "\n",
    "plt.subplot(224)\n",
    "feature_importance(pipe.named_steps['model'].feature_importances_, X.columns)\n",
    "\n",
    "plt.tight_layout()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "eb13d68e18139ed3ca7fe282547d99838f7f2d8b"
   },
   "outputs": [],
   "source": [
    "ert_xval_res = cross_validate_model(pipe, X, y, verbose=False)\n",
    "ert_xval_res.T[['value','error']].style.format(\"{:.2f}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "_uuid": "59ebb7aa871678f1f7cda4bd66c081e56012fd29"
   },
   "source": [
    "<a id='conclusion'></a>\n",
    "## Model comparison and conclusions\n",
    "The table below summarizes the performance of the classification models that I considered in this study. Performances are ordered by increasing value of $F_{1}$. The best performances are obtained by the **extremely randomized tree**, followed by the **random forest** and the **logistic regression**. \n",
    "\n",
    "The extremely randomized tree allow to identify up to 66% of loans which would cause a DEFAULT while retaining 91% of loans which would be PAID in time. The ROC AUC value is as high as 96%, indicating that the probabilty that the classifier would perform better by random choice is as low as 4%."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "_uuid": "5dd30c501a228b91bb34fd8f04aeee7ebd9918f4"
   },
   "outputs": [],
   "source": [
    "from collections import OrderedDict\n",
    "\n",
    "res_comp = OrderedDict([\n",
    "    ('Logistic regression'              , logit_xval_res[1:]),\n",
    "    ('SGD classifier'                   , sgd_xval_res[1:]  ),\n",
    "    ('Supporting vector classifier'     , svc_xval_res[1:]  ),\n",
    "    ('Random forest classifier'         , rfc_xval_res[1:]  ),\n",
    "    ('Extermely random tree classifier' , ert_xval_res[1:]  ),\n",
    "    ('Gradient boost classifier'        , gbc_xval_res[1:]  ),\n",
    "])\n",
    "\n",
    "new_columns = {'level_0' : 'Model'}\n",
    "\n",
    "pd.concat(res_comp).reset_index().drop('level_1', axis=1).rename(columns=new_columns).set_index('Model').sort_values('F1', ascending=False).style.format(\"{:.2f}\")"
   ]
  }
 ],
 "metadata": {
  "hide_input": true,
  "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.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}