| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- ///////////////////////////////////////////
- // Running convGAN on imblearn_mammography
- ///////////////////////////////////////////
- Load 'data_input/imblearn_mammography'
- from imblearn
- non empty cut in data_input/imblearn_mammography! (7 points)
- Data loaded.
- -> Shuffling data
- ### Start exercise for synthetic point generator
- ====== Step 1/5 =======
- -> Shuffling data
- -> Spliting data to slices
- ------ Step 1/5: Slice 1/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1899, 286
- LR fn, tp: 6, 46
- LR f1 score: 0.240
- LR cohens kappa score: 0.208
- LR average precision score: 0.557
- -> test with 'GB'
- GB tn, fp: 2124, 61
- GB fn, tp: 12, 40
- GB f1 score: 0.523
- GB cohens kappa score: 0.508
- -> test with 'KNN'
- KNN tn, fp: 2091, 94
- KNN fn, tp: 7, 45
- KNN f1 score: 0.471
- KNN cohens kappa score: 0.453
- ------ Step 1/5: Slice 2/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1906, 279
- LR fn, tp: 6, 46
- LR f1 score: 0.244
- LR cohens kappa score: 0.212
- LR average precision score: 0.489
- -> test with 'GB'
- GB tn, fp: 2142, 43
- GB fn, tp: 12, 40
- GB f1 score: 0.593
- GB cohens kappa score: 0.581
- -> test with 'KNN'
- KNN tn, fp: 2106, 79
- KNN fn, tp: 7, 45
- KNN f1 score: 0.511
- KNN cohens kappa score: 0.495
- ------ Step 1/5: Slice 3/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1906, 279
- LR fn, tp: 6, 46
- LR f1 score: 0.244
- LR cohens kappa score: 0.212
- LR average precision score: 0.606
- -> test with 'GB'
- GB tn, fp: 2155, 30
- GB fn, tp: 15, 37
- GB f1 score: 0.622
- GB cohens kappa score: 0.612
- -> test with 'KNN'
- KNN tn, fp: 2106, 79
- KNN fn, tp: 7, 45
- KNN f1 score: 0.511
- KNN cohens kappa score: 0.495
- ------ Step 1/5: Slice 4/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1891, 294
- LR fn, tp: 6, 46
- LR f1 score: 0.235
- LR cohens kappa score: 0.203
- LR average precision score: 0.335
- -> test with 'GB'
- GB tn, fp: 2136, 49
- GB fn, tp: 16, 36
- GB f1 score: 0.526
- GB cohens kappa score: 0.511
- -> test with 'KNN'
- KNN tn, fp: 2083, 102
- KNN fn, tp: 8, 44
- KNN f1 score: 0.444
- KNN cohens kappa score: 0.425
- ------ Step 1/5: Slice 5/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8532 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1922, 261
- LR fn, tp: 6, 46
- LR f1 score: 0.256
- LR cohens kappa score: 0.225
- LR average precision score: 0.555
- -> test with 'GB'
- GB tn, fp: 2140, 43
- GB fn, tp: 12, 40
- GB f1 score: 0.593
- GB cohens kappa score: 0.581
- -> test with 'KNN'
- KNN tn, fp: 2096, 87
- KNN fn, tp: 12, 40
- KNN f1 score: 0.447
- KNN cohens kappa score: 0.428
- ====== Step 2/5 =======
- -> Shuffling data
- -> Spliting data to slices
- ------ Step 2/5: Slice 1/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1880, 305
- LR fn, tp: 6, 46
- LR f1 score: 0.228
- LR cohens kappa score: 0.196
- LR average precision score: 0.484
- -> test with 'GB'
- GB tn, fp: 2130, 55
- GB fn, tp: 15, 37
- GB f1 score: 0.514
- GB cohens kappa score: 0.499
- -> test with 'KNN'
- KNN tn, fp: 2081, 104
- KNN fn, tp: 8, 44
- KNN f1 score: 0.440
- KNN cohens kappa score: 0.420
- ------ Step 2/5: Slice 2/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1870, 315
- LR fn, tp: 7, 45
- LR f1 score: 0.218
- LR cohens kappa score: 0.185
- LR average precision score: 0.461
- -> test with 'GB'
- GB tn, fp: 2120, 65
- GB fn, tp: 12, 40
- GB f1 score: 0.510
- GB cohens kappa score: 0.494
- -> test with 'KNN'
- KNN tn, fp: 2074, 111
- KNN fn, tp: 6, 46
- KNN f1 score: 0.440
- KNN cohens kappa score: 0.420
- ------ Step 2/5: Slice 3/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1920, 265
- LR fn, tp: 7, 45
- LR f1 score: 0.249
- LR cohens kappa score: 0.217
- LR average precision score: 0.495
- -> test with 'GB'
- GB tn, fp: 2145, 40
- GB fn, tp: 16, 36
- GB f1 score: 0.562
- GB cohens kappa score: 0.550
- -> test with 'KNN'
- KNN tn, fp: 2098, 87
- KNN fn, tp: 11, 41
- KNN f1 score: 0.456
- KNN cohens kappa score: 0.437
- ------ Step 2/5: Slice 4/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1913, 272
- LR fn, tp: 4, 48
- LR f1 score: 0.258
- LR cohens kappa score: 0.227
- LR average precision score: 0.476
- -> test with 'GB'
- GB tn, fp: 2153, 32
- GB fn, tp: 12, 40
- GB f1 score: 0.645
- GB cohens kappa score: 0.635
- -> test with 'KNN'
- KNN tn, fp: 2089, 96
- KNN fn, tp: 6, 46
- KNN f1 score: 0.474
- KNN cohens kappa score: 0.456
- ------ Step 2/5: Slice 5/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8532 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1874, 309
- LR fn, tp: 8, 44
- LR f1 score: 0.217
- LR cohens kappa score: 0.184
- LR average precision score: 0.553
- -> test with 'GB'
- GB tn, fp: 2144, 39
- GB fn, tp: 16, 36
- GB f1 score: 0.567
- GB cohens kappa score: 0.555
- -> test with 'KNN'
- KNN tn, fp: 2115, 68
- KNN fn, tp: 10, 42
- KNN f1 score: 0.519
- KNN cohens kappa score: 0.503
- ====== Step 3/5 =======
- -> Shuffling data
- -> Spliting data to slices
- ------ Step 3/5: Slice 1/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1909, 276
- LR fn, tp: 6, 46
- LR f1 score: 0.246
- LR cohens kappa score: 0.215
- LR average precision score: 0.541
- -> test with 'GB'
- GB tn, fp: 2154, 31
- GB fn, tp: 12, 40
- GB f1 score: 0.650
- GB cohens kappa score: 0.641
- -> test with 'KNN'
- KNN tn, fp: 2101, 84
- KNN fn, tp: 6, 46
- KNN f1 score: 0.505
- KNN cohens kappa score: 0.489
- ------ Step 3/5: Slice 2/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1890, 295
- LR fn, tp: 6, 46
- LR f1 score: 0.234
- LR cohens kappa score: 0.202
- LR average precision score: 0.413
- -> test with 'GB'
- GB tn, fp: 2136, 49
- GB fn, tp: 14, 38
- GB f1 score: 0.547
- GB cohens kappa score: 0.533
- -> test with 'KNN'
- KNN tn, fp: 2084, 101
- KNN fn, tp: 11, 41
- KNN f1 score: 0.423
- KNN cohens kappa score: 0.402
- ------ Step 3/5: Slice 3/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1869, 316
- LR fn, tp: 2, 50
- LR f1 score: 0.239
- LR cohens kappa score: 0.207
- LR average precision score: 0.464
- -> test with 'GB'
- GB tn, fp: 2133, 52
- GB fn, tp: 9, 43
- GB f1 score: 0.585
- GB cohens kappa score: 0.572
- -> test with 'KNN'
- KNN tn, fp: 2105, 80
- KNN fn, tp: 5, 47
- KNN f1 score: 0.525
- KNN cohens kappa score: 0.509
- ------ Step 3/5: Slice 4/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1912, 273
- LR fn, tp: 9, 43
- LR f1 score: 0.234
- LR cohens kappa score: 0.202
- LR average precision score: 0.489
- -> test with 'GB'
- GB tn, fp: 2138, 47
- GB fn, tp: 18, 34
- GB f1 score: 0.511
- GB cohens kappa score: 0.497
- -> test with 'KNN'
- KNN tn, fp: 2101, 84
- KNN fn, tp: 11, 41
- KNN f1 score: 0.463
- KNN cohens kappa score: 0.445
- ------ Step 3/5: Slice 5/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8532 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1911, 272
- LR fn, tp: 7, 45
- LR f1 score: 0.244
- LR cohens kappa score: 0.212
- LR average precision score: 0.570
- -> test with 'GB'
- GB tn, fp: 2145, 38
- GB fn, tp: 17, 35
- GB f1 score: 0.560
- GB cohens kappa score: 0.548
- -> test with 'KNN'
- KNN tn, fp: 2098, 85
- KNN fn, tp: 10, 42
- KNN f1 score: 0.469
- KNN cohens kappa score: 0.451
- ====== Step 4/5 =======
- -> Shuffling data
- -> Spliting data to slices
- ------ Step 4/5: Slice 1/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1927, 258
- LR fn, tp: 7, 45
- LR f1 score: 0.254
- LR cohens kappa score: 0.223
- LR average precision score: 0.551
- -> test with 'GB'
- GB tn, fp: 2143, 42
- GB fn, tp: 19, 33
- GB f1 score: 0.520
- GB cohens kappa score: 0.506
- -> test with 'KNN'
- KNN tn, fp: 2123, 62
- KNN fn, tp: 11, 41
- KNN f1 score: 0.529
- KNN cohens kappa score: 0.514
- ------ Step 4/5: Slice 2/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1899, 286
- LR fn, tp: 5, 47
- LR f1 score: 0.244
- LR cohens kappa score: 0.212
- LR average precision score: 0.413
- -> test with 'GB'
- GB tn, fp: 2146, 39
- GB fn, tp: 15, 37
- GB f1 score: 0.578
- GB cohens kappa score: 0.566
- -> test with 'KNN'
- KNN tn, fp: 2104, 81
- KNN fn, tp: 8, 44
- KNN f1 score: 0.497
- KNN cohens kappa score: 0.480
- ------ Step 4/5: Slice 3/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1915, 270
- LR fn, tp: 7, 45
- LR f1 score: 0.245
- LR cohens kappa score: 0.214
- LR average precision score: 0.458
- -> test with 'GB'
- GB tn, fp: 2150, 35
- GB fn, tp: 11, 41
- GB f1 score: 0.641
- GB cohens kappa score: 0.630
- -> test with 'KNN'
- KNN tn, fp: 2093, 92
- KNN fn, tp: 9, 43
- KNN f1 score: 0.460
- KNN cohens kappa score: 0.441
- ------ Step 4/5: Slice 4/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1916, 269
- LR fn, tp: 9, 43
- LR f1 score: 0.236
- LR cohens kappa score: 0.205
- LR average precision score: 0.487
- -> test with 'GB'
- GB tn, fp: 2133, 52
- GB fn, tp: 12, 40
- GB f1 score: 0.556
- GB cohens kappa score: 0.542
- -> test with 'KNN'
- KNN tn, fp: 2085, 100
- KNN fn, tp: 9, 43
- KNN f1 score: 0.441
- KNN cohens kappa score: 0.421
- ------ Step 4/5: Slice 5/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8532 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1850, 333
- LR fn, tp: 1, 51
- LR f1 score: 0.234
- LR cohens kappa score: 0.201
- LR average precision score: 0.510
- -> test with 'GB'
- GB tn, fp: 2129, 54
- GB fn, tp: 8, 44
- GB f1 score: 0.587
- GB cohens kappa score: 0.574
- -> test with 'KNN'
- KNN tn, fp: 1447, 736
- KNN fn, tp: 9, 43
- KNN f1 score: 0.103
- KNN cohens kappa score: 0.063
- ====== Step 5/5 =======
- -> Shuffling data
- -> Spliting data to slices
- ------ Step 5/5: Slice 1/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1784, 401
- LR fn, tp: 1, 51
- LR f1 score: 0.202
- LR cohens kappa score: 0.168
- LR average precision score: 0.510
- -> test with 'GB'
- GB tn, fp: 2153, 32
- GB fn, tp: 15, 37
- GB f1 score: 0.612
- GB cohens kappa score: 0.601
- -> test with 'KNN'
- KNN tn, fp: 2115, 70
- KNN fn, tp: 8, 44
- KNN f1 score: 0.530
- KNN cohens kappa score: 0.515
- ------ Step 5/5: Slice 2/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1905, 280
- LR fn, tp: 7, 45
- LR f1 score: 0.239
- LR cohens kappa score: 0.207
- LR average precision score: 0.436
- -> test with 'GB'
- GB tn, fp: 2142, 43
- GB fn, tp: 12, 40
- GB f1 score: 0.593
- GB cohens kappa score: 0.581
- -> test with 'KNN'
- KNN tn, fp: 2078, 107
- KNN fn, tp: 7, 45
- KNN f1 score: 0.441
- KNN cohens kappa score: 0.421
- ------ Step 5/5: Slice 3/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1909, 276
- LR fn, tp: 8, 44
- LR f1 score: 0.237
- LR cohens kappa score: 0.205
- LR average precision score: 0.510
- -> test with 'GB'
- GB tn, fp: 2143, 42
- GB fn, tp: 19, 33
- GB f1 score: 0.520
- GB cohens kappa score: 0.506
- -> test with 'KNN'
- KNN tn, fp: 2100, 85
- KNN fn, tp: 10, 42
- KNN f1 score: 0.469
- KNN cohens kappa score: 0.451
- ------ Step 5/5: Slice 4/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8530 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1709, 476
- LR fn, tp: 4, 48
- LR f1 score: 0.167
- LR cohens kappa score: 0.130
- LR average precision score: 0.525
- -> test with 'GB'
- GB tn, fp: 2136, 49
- GB fn, tp: 12, 40
- GB f1 score: 0.567
- GB cohens kappa score: 0.554
- -> test with 'KNN'
- KNN tn, fp: 2095, 90
- KNN fn, tp: 9, 43
- KNN f1 score: 0.465
- KNN cohens kappa score: 0.446
- ------ Step 5/5: Slice 5/5 -------
- -> Reset the GAN
- -> Train generator for synthetic samples
- -> create 8532 synthetic samples
- -> test with 'LR'
- LR tn, fp: 1832, 351
- LR fn, tp: 6, 46
- LR f1 score: 0.205
- LR cohens kappa score: 0.171
- LR average precision score: 0.589
- -> test with 'GB'
- GB tn, fp: 2137, 46
- GB fn, tp: 16, 36
- GB f1 score: 0.537
- GB cohens kappa score: 0.524
- -> test with 'KNN'
- KNN tn, fp: 2098, 85
- KNN fn, tp: 10, 42
- KNN f1 score: 0.469
- KNN cohens kappa score: 0.451
- ### Exercise is done.
- -----[ LR ]-----
- maximum:
- LR tn, fp: 1927, 476
- LR fn, tp: 9, 51
- LR f1 score: 0.258
- LR cohens kappa score: 0.227
- LR average precision score: 0.606
- average:
- LR tn, fp: 1884.72, 299.88
- LR fn, tp: 5.88, 46.12
- LR f1 score: 0.234
- LR cohens kappa score: 0.202
- LR average precision score: 0.499
- minimum:
- LR tn, fp: 1709, 258
- LR fn, tp: 1, 43
- LR f1 score: 0.167
- LR cohens kappa score: 0.130
- LR average precision score: 0.335
- -----[ GB ]-----
- maximum:
- GB tn, fp: 2155, 65
- GB fn, tp: 19, 44
- GB f1 score: 0.650
- GB cohens kappa score: 0.641
- average:
- GB tn, fp: 2140.28, 44.32
- GB fn, tp: 13.88, 38.12
- GB f1 score: 0.569
- GB cohens kappa score: 0.556
- minimum:
- GB tn, fp: 2120, 30
- GB fn, tp: 8, 33
- GB f1 score: 0.510
- GB cohens kappa score: 0.494
- -----[ KNN ]-----
- maximum:
- KNN tn, fp: 2123, 736
- KNN fn, tp: 12, 47
- KNN f1 score: 0.530
- KNN cohens kappa score: 0.515
- average:
- KNN tn, fp: 2070.64, 113.96
- KNN fn, tp: 8.6, 43.4
- KNN f1 score: 0.460
- KNN cohens kappa score: 0.441
- minimum:
- KNN tn, fp: 1447, 62
- KNN fn, tp: 5, 40
- KNN f1 score: 0.103
- KNN cohens kappa score: 0.063
|