diff --git a/.coverage b/.coverage new file mode 100644 index 0000000..66ca32c Binary files /dev/null and b/.coverage differ diff --git a/out.html b/out.html deleted file mode 100644 index 7de9363..0000000 --- a/out.html +++ /dev/null @@ -1,2237 +0,0 @@ -spambase -Loading spambase (Spambase Data Set) -#instances=4601, type=, #features=57, #classes=[0 1], prevs=[0.606, 0.394] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
basetrueestimerrors
01T0F1F0T1T0F1F0T1maeraemraekldnkldf1e_truef1e_estim
00.00001.00000.00000.00000.10000.90000.00000.00380.00000.99620.05000.45710.45710.22540.1122NaN1.0000
10.00001.00000.00000.00000.08000.92000.00000.00080.00000.99920.04000.29810.29810.16410.0819NaN0.9907
20.00001.00000.00000.00000.11000.89000.00000.00120.00000.99880.05500.32890.32890.25680.1277NaN1.0000
30.00001.00000.00000.00000.09000.91000.00000.00730.00000.99270.04500.62310.62310.19600.0977NaN0.9999
40.00001.00000.00000.00000.10000.90000.00000.01780.00000.98220.05001.15221.15220.23340.1162NaN1.0000
50.00001.00000.00000.00000.06000.94000.00000.00070.00000.99930.03000.27960.27960.10860.0542NaN1.0000
60.00001.00000.00000.00000.12000.88000.00000.00080.00000.99920.06000.31500.31500.28980.1439NaN1.0000
70.00001.00000.00000.00000.11000.89000.00000.00050.00000.99950.05500.29650.29650.25680.1277NaN1.0000
80.00001.00000.00000.00000.09000.91000.00000.00090.00000.99910.04500.30550.30550.19390.0966NaN0.9761
90.00001.00000.00000.00000.14000.86000.00000.02220.00000.97780.07001.38671.38670.36940.1826NaN1.0000
100.10000.90000.09000.01000.08000.82000.00850.20460.00000.78690.09733.70343.70340.42040.20720.33330.9233
110.10000.90000.10000.00000.11000.79000.02880.07690.00000.89430.09064.28634.28630.36760.18170.35480.5715
120.10000.90000.10000.00000.10000.80000.06490.05010.00000.88500.06752.85202.85200.26890.13370.33330.2786
130.10000.90000.10000.00000.06000.84000.01820.16560.00000.81610.08288.71458.71450.33170.16430.23080.8196
140.10000.90000.09000.01000.08000.82000.02430.10760.00000.86810.07282.04922.04920.27550.13690.33330.6885
150.10000.90000.10000.00000.08000.82000.07670.02190.00000.90150.05171.40881.40880.18110.09030.28570.1248
160.10000.90000.08000.02000.07000.83000.01760.04960.00010.93270.06620.74380.74380.19810.09870.36000.5856
170.10000.90000.08000.02000.13000.77000.02100.19400.00000.78500.09452.15862.15860.47880.23490.48390.8218
180.10000.90000.08000.02000.12000.78000.01780.13580.00000.84640.09111.60241.60240.40740.20090.46670.7928
190.10000.90000.07000.03000.10000.80000.03520.13770.00000.82710.06741.13161.13160.29060.14430.48150.6616
200.20000.80000.20000.00000.11000.69000.11760.22430.00000.65810.112211.567111.56710.47950.23530.21570.4881
210.20000.80000.20000.00000.06000.74000.15030.04400.00030.80540.05472.51082.51080.14550.07260.13040.1284
220.20000.80000.18000.02000.07000.73000.06500.11820.00000.81680.09251.40041.40040.26100.12970.20000.4762
230.20000.80000.19000.01000.11000.69000.15180.02090.00000.82730.07410.51860.51860.26960.13400.24000.0643
240.20000.80000.19000.01000.11000.69000.06760.38400.00000.54840.18706.68056.68050.66270.31970.24000.7395
250.20000.80000.20000.00000.08000.72000.12450.10060.00000.77490.07785.37635.37630.26680.13260.16670.2878
260.20000.80000.19000.01000.10000.70000.14070.09860.00000.76080.07471.79891.79890.28930.14360.22450.2594
270.20000.80000.19000.01000.09000.71000.09920.12360.00000.77720.09042.26992.26990.30550.15160.20830.3838
280.20000.80000.20000.00000.07000.73000.15620.07550.00000.76830.05694.07274.07270.20110.10020.14890.1945
290.20000.80000.19000.01000.10000.70000.12020.04600.00000.83380.08490.97430.97430.26520.13180.22450.1605
300.30000.70000.29000.01000.08000.62000.20280.16600.00000.63130.08362.91312.91310.29660.14720.13430.2904
310.30000.70000.29000.01000.05000.65000.23590.10080.00000.66340.05211.79081.79080.14910.07440.09380.1760
320.30000.70000.27000.03000.07000.63000.18810.21810.00000.59380.09401.66541.66540.27280.13550.15620.3670
330.30000.70000.28000.02000.06000.64000.20940.08790.00000.70280.06530.99560.99560.15520.07740.12500.1734
340.30000.70000.28000.02000.03000.67000.17890.08050.00000.74070.06560.93390.93390.09510.04750.08200.1836
350.30000.70000.29000.01000.10000.60000.16980.24190.00000.58840.11594.20904.20900.44380.21830.15940.4160
360.30000.70000.30000.00000.08000.62000.25060.06920.00000.68010.06473.76083.76080.22380.11140.11760.1213
370.30000.70000.24000.06000.07000.63000.06370.31390.00000.62250.12691.39271.39270.41900.20650.21310.7114
380.30000.70000.27000.03000.06000.64000.14990.23030.00000.61980.10011.77821.77820.27830.13830.14290.4343
390.30000.70000.28000.02000.04000.66000.15160.18180.00000.66660.08421.95541.95540.21270.10600.09680.3749
400.40000.60000.39000.01000.07000.53000.22610.31430.00000.45950.15225.44235.44230.44450.21870.09300.4100
410.40000.60000.35000.05000.05000.55000.26130.18930.00000.54940.06970.92330.92330.16520.08240.12500.2660
420.40000.60000.38000.02000.08000.52000.21330.24900.00000.53770.12342.64222.64220.38390.18960.11630.3686
430.40000.60000.39000.01000.05000.55000.22470.34920.00000.42610.16966.04056.04050.43880.21590.07140.4373
440.40000.60000.38000.02000.09000.51000.26340.22140.00000.51520.10332.32902.32900.35830.17730.12640.2959
450.40000.60000.38000.02000.06000.54000.21250.28610.00000.50140.13313.01843.01840.36530.18060.09520.4024
460.40000.60000.39000.01000.05000.55000.32250.16080.00000.51660.07542.79902.79900.20420.10180.07140.1996
470.40000.60000.36000.04000.05000.55000.19310.36640.00000.44050.16322.20412.20410.38190.18870.11110.4868
480.40000.60000.35000.05000.04000.56000.24120.18340.00000.57540.07440.91190.91190.14580.07280.11390.2754
490.40000.60000.38000.02000.08000.52000.29010.18350.00000.52640.08491.93181.93180.28630.14220.11630.2403
500.50000.50000.47000.03000.02000.48000.26610.25480.00000.47910.11241.91351.91350.23730.11810.05050.3237
510.50000.50000.46000.04000.07000.43000.30660.28720.00000.40620.12361.70291.70290.32950.16330.10680.3190
520.50000.50000.49000.01000.07000.43000.44880.04990.00000.50130.05560.96010.96010.16060.08010.07550.0527
530.50000.50000.47000.03000.01000.49000.31170.28130.00000.40700.12572.08712.08710.22630.11270.04080.3109
540.50000.50000.47000.03000.05000.45000.38570.13250.00000.48180.06721.02151.02150.14610.07290.07840.1466
550.50000.50000.45000.05000.09000.41000.36110.21640.00000.42240.08941.04981.04980.28970.14380.13460.2306
560.50000.50000.43000.07000.07000.43000.26650.35180.00000.38170.14091.29421.29420.34230.16950.14000.3975
570.50000.50000.46000.04000.03000.47000.29690.20030.00000.50280.09661.20991.20990.16900.08430.07070.2523
580.50000.50000.49000.01000.02000.48000.40310.07200.00000.52490.05341.30031.30030.06830.03410.02970.0820
590.50000.50000.49000.01000.06000.44000.33520.30220.00000.36260.14615.22255.22250.39210.19360.06670.3107
600.60000.40000.55000.05000.02000.38000.37230.26170.00000.36600.10591.25151.25150.18190.09070.05980.2601
610.60000.40000.55000.05000.06000.34000.39440.34780.00000.25770.14891.71431.71430.34100.16890.09090.3060
620.60000.40000.58000.02000.06000.34000.48830.18690.00000.32480.08351.95031.95030.23110.11500.06450.1607
630.60000.40000.59000.01000.03000.37000.46910.30980.00000.22110.14995.36115.36110.34740.17190.03280.2482
640.60000.40000.57000.03000.06000.34000.40360.32640.00000.27000.14822.47092.47090.36270.17940.07320.2879
650.60000.40000.57000.03000.01000.39000.32510.34880.00000.32620.15942.59042.59040.32430.16070.03390.3491
660.60000.40000.53000.07000.05000.35000.29770.47880.00000.22350.20441.78751.78750.45310.22280.10170.4457
670.60000.40000.56000.04000.06000.34000.44910.23670.00000.31420.09831.39121.39120.24130.12010.08200.2086
680.60000.40000.56000.04000.04000.36000.40480.30600.00000.28920.13301.81691.81690.27200.13520.06670.2743
690.60000.40000.59000.01000.03000.37000.44620.23880.00000.31500.11444.12444.12440.25030.12450.03280.2111
700.70000.30000.69000.01000.02000.28000.63740.05340.00000.30930.03630.96790.96790.04680.02340.02130.0402
710.70000.30000.66000.04000.01000.29000.56460.21080.00000.22460.08541.20711.20710.12290.06140.03650.1573
720.70000.30000.64000.06000.03000.27000.56260.13370.00000.30370.05370.55840.55840.06950.03470.06570.1062
730.70000.30000.64000.06000.01000.29000.48900.32800.00000.18310.13401.34651.34650.21520.10720.05190.2512
740.70000.30000.63000.07000.02000.28000.47170.28270.00000.24560.10631.00151.00150.15810.07890.06670.2305
750.70000.30000.68000.02000.03000.27000.59140.21230.00000.19630.09612.23662.23660.19470.09700.03550.1522
760.70000.30000.66000.04000.03000.27000.61640.13000.00000.25350.04500.74570.74570.08070.04030.05040.0954
770.70000.30000.66000.04000.01000.29000.54850.19400.00000.25750.07701.09171.09170.10610.05300.03650.1503
780.70000.30000.66000.04000.05000.25000.55830.26940.00000.17230.11471.61611.61610.25360.12610.06380.1944
790.70000.30000.68000.02000.03000.27000.48310.29380.00000.22310.13693.06673.06670.28960.14380.03550.2332
800.80000.20000.73000.07000.03000.17000.58470.30970.00000.10560.11991.15471.15470.20270.10100.06410.2094
810.80000.20000.73000.07000.03000.17000.51180.33320.00000.15500.13161.18731.18730.22970.11440.06410.2456
820.80000.20000.71000.09000.00000.20000.53720.25000.00000.21270.08640.49870.49870.09160.04570.05960.1888
830.80000.20000.75000.05000.07000.13000.75680.15190.00000.09130.05440.77030.77030.18430.09190.07410.0912
840.80000.20000.76000.04000.02000.18000.70050.21420.00000.08530.08711.31521.31520.16370.08160.03800.1326
850.80000.20000.75000.05000.01000.19000.65690.14930.00000.19380.05160.65390.65390.05540.02770.03850.1021
860.80000.20000.76000.04000.01000.19000.61340.22220.00000.16440.09111.25961.25960.13380.06680.03180.1534
870.80000.20000.75000.05000.01000.19000.66290.23200.00000.10510.09101.13131.13130.14010.06990.03850.1489
880.80000.20000.74000.06000.00000.20000.58570.30810.00000.10620.12401.12041.12040.19610.09770.03900.2082
890.80000.20000.74000.06000.02000.18000.45810.46950.00000.07240.20482.01522.01520.42650.21010.05130.3389
900.90000.10000.86000.04000.02000.08000.86810.10340.00000.02840.03580.70630.70630.07180.03590.03370.0562
910.90000.10000.82000.08000.02000.08000.69540.23120.00020.07320.07560.70020.70020.09450.04720.05750.1426
920.90000.10000.85000.05000.01000.09000.71360.22090.00010.06540.08541.04581.04580.11550.05770.03410.1341
930.90000.10000.83000.07000.01000.09000.65370.29120.00000.05520.11061.04831.04830.15490.07730.04600.1822
940.90000.10000.83000.07000.00000.10000.82850.08100.00000.09050.00550.06020.06020.00120.00060.04050.0466
950.90000.10000.85000.05000.00000.10000.72450.22440.00000.05110.08720.94590.94590.12300.06140.02860.1341
960.90000.10000.86000.04000.01000.09000.67970.32020.00000.00010.14012.01202.01200.40730.20090.02820.1907
970.90000.10000.85000.05000.00000.10000.79740.11660.00000.08590.03330.35170.35170.02570.01280.02860.0681
980.90000.10000.86000.04000.01000.09000.78100.20400.00010.01490.08201.29671.29670.17830.08890.02820.1155
990.90000.10000.84000.06000.00000.10000.71520.16070.00000.12420.06240.48170.48170.05250.02630.03450.1010
1001.00000.00000.93000.07000.00000.00000.95650.02290.00000.02060.02361.19241.19240.03990.01990.03630.0118
1011.00000.00000.94000.06000.00000.00000.89540.07360.00000.03100.02231.61281.61280.02340.01170.03090.0395
1021.00000.00000.98000.02000.00000.00000.94860.05140.00000.00000.01570.32200.32200.01150.00580.01010.0264
1031.00000.00000.94000.06000.00000.00000.93170.06280.00000.00540.00410.28420.28420.00180.00090.03090.0326
1041.00000.00000.97000.03000.00000.00000.77350.22650.00000.00000.09821.45401.45400.15330.07650.01520.1277
1051.00000.00000.93000.07000.00000.00000.84940.12750.00000.02310.04031.36761.36760.03300.01650.03630.0698
1061.00000.00000.95000.05000.00000.00000.97350.01480.00010.01160.01760.75360.75360.02690.01350.02560.0076
1071.00000.00000.94000.06000.00000.00000.91790.04920.00000.03290.01651.69441.69440.02410.01200.03090.0261
1081.00000.00000.96000.04000.00000.00000.90190.09810.00010.00000.02910.34050.34050.02260.01130.02040.0516
1091.00000.00000.94000.06000.00000.00000.94430.02360.00030.03170.01821.74331.74330.03870.01940.03090.0125
-************************************************** diff --git a/out_imdb.html b/out_imdb.html new file mode 100644 index 0000000..aa6dd34 --- /dev/null +++ b/out_imdb.html @@ -0,0 +1,801 @@ + + + + + +
imdb
+
Tests:
+
protocol=APP
+
n_prevalences=21
+
repreats=1000
+
 
+
binary
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basetrueestimerrors
01T0F1F0T1T0F1F0T1aef1_truef1_estimf1_dist
00.00001.00000.00000.00000.11000.89000.00380.01080.10620.87920.0073NaN0.0565NaN
10.05000.95000.04480.00520.10500.84500.04540.01100.10440.83920.01640.45700.42740.1598
20.10000.90000.08900.01100.09810.80190.09280.01340.09430.79950.01940.62470.62800.1120
30.15000.85000.13290.01710.09480.75520.13940.01570.08830.75660.02450.70620.72370.1044
40.20000.80000.17760.02240.08700.71300.18600.01670.07850.71880.02560.76610.79420.0858
50.25000.75000.22250.02750.08370.66630.23240.01920.07380.67460.02820.80130.83160.0781
60.30000.70000.26680.03320.07600.62400.27730.02190.06550.63530.02930.83060.86230.0677
70.35000.65000.31000.04000.07120.57880.32520.02640.05600.59240.03240.84800.88670.0677
80.40000.60000.35500.04500.06480.53520.36820.02820.05160.55200.03150.86610.90170.0589
90.45000.55000.39880.05120.06000.49000.41270.03350.04610.50780.03260.87760.91150.0549
100.50000.50000.44390.05610.05470.44530.45800.03700.04050.46440.03330.88890.92170.0507
110.55000.45000.48950.06050.04980.40020.50140.04280.03790.41790.03370.89850.92520.0465
120.60000.40000.53180.06830.04370.35630.54460.04650.03090.37810.03330.90450.93360.0441
130.65000.35000.57550.07450.03920.31080.58430.05370.03040.33160.03270.90980.93260.0396
140.70000.30000.62190.07810.03260.26740.62920.05790.02530.28760.03130.91810.93790.0350
150.75000.25000.66410.08590.02730.22270.67080.06690.02060.24170.03000.92120.93890.0317
160.80000.20000.70840.09160.02260.17740.71200.07280.01900.19630.02860.92520.93930.0283
170.85000.15000.75360.09640.01670.13330.75330.08160.01700.14810.02510.93000.93840.0230
180.90000.10000.80090.09910.01090.08910.79790.08720.01390.10100.02250.93550.94020.0203
190.95000.05000.84370.10630.00570.04430.83640.09940.01300.05120.01810.93740.93670.0154
201.00000.00000.88860.11140.00000.00000.87900.10180.00960.00960.00960.94070.94000.0082
+
 
+
multiclass
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basetrueestimerrors
01T0F1F0T1T0F1F0T1aef1_truef1_estimf1_dist
00.00001.00000.00000.00000.11000.89000.00570.01430.10120.87880.0125NaN0.0854NaN
10.05000.95000.04480.00520.10500.84500.05050.01430.09700.83820.01970.45700.46510.1655
20.10000.90000.08900.01100.09810.80190.09820.01620.08650.79910.02220.62470.65410.1180
30.15000.85000.13290.01710.09480.75520.14520.01890.08030.75560.02740.70620.74210.1113
40.20000.80000.17760.02240.08700.71300.19190.01970.07060.71770.02800.76610.80810.0927
50.25000.75000.22250.02750.08370.66630.23780.02240.06690.67290.03060.80130.84080.0818
60.30000.70000.26680.03320.07600.62400.28240.02560.05860.63340.03150.83060.86930.0711
70.35000.65000.31000.04000.07120.57880.32960.02950.05030.59050.03390.84800.89130.0696
80.40000.60000.35500.04500.06480.53520.37260.03120.04620.55010.03360.86610.90550.0610
90.45000.55000.39880.05120.06000.49000.41600.03550.04220.50640.03390.87760.91410.0554
100.50000.50000.44390.05610.05470.44530.46080.03730.03820.46370.03460.88890.92410.0516
110.55000.45000.48950.06050.04980.40020.50440.04250.03550.41760.03460.89850.92800.0471
120.60000.40000.53180.06830.04370.35630.54680.04520.02960.37830.03440.90450.93590.0448
130.65000.35000.57550.07450.03920.31080.58660.05180.02930.33230.03380.90980.93520.0403
140.70000.30000.62190.07810.03260.26740.63120.05340.02580.28960.03310.91810.94080.0367
150.75000.25000.66410.08590.02730.22270.67300.06190.02070.24450.03220.92120.94230.0335
160.80000.20000.70840.09160.02260.17740.71410.06570.02000.20010.03090.92520.94310.0304
170.85000.15000.75360.09640.01670.13330.75560.07560.01710.15170.02740.93000.94200.0247
180.90000.10000.80090.09910.01090.08910.80000.07990.01500.10500.02500.93550.94370.0223
190.95000.05000.84370.10630.00570.04430.83890.09160.01400.05550.02090.93740.94050.0167
201.00000.00000.88860.11140.00000.00000.88110.09650.01080.01160.01350.94070.94220.0108
+ + \ No newline at end of file diff --git a/out_spambase.html b/out_spambase.html new file mode 100644 index 0000000..34d9932 --- /dev/null +++ b/out_spambase.html @@ -0,0 +1,802 @@ + + + + + +
spambase
+
#instances=4601, type=, #features=57, #classes=[0 1], prevs=[0.606, 0.394]
+
Tests:
+
protocol=APP
+
n_prevalences=21
+
repreats=1000
+
 
+
binary
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basetrueestimerrors
01T0F1F0T1T0F1F0T1aef1_truef1_estimf1_dist
00.00001.00000.00000.00000.09490.90520.00670.00120.08820.90400.0039NaN0.1154NaN
10.05000.95000.04700.00300.09080.85920.05840.00200.07940.86010.01140.50950.58280.1418
20.10000.90000.09400.00600.08670.81330.10900.00300.07170.81630.01470.67480.74170.1057
30.15000.85000.14100.00900.08170.76830.15850.00390.06420.77330.01800.75930.82050.0926
40.20000.80000.18820.01180.07610.72380.20810.00660.05620.72910.02030.81210.86760.0762
50.25000.75000.23600.01400.07070.67940.25640.00730.05030.68600.02120.84910.89820.0662
60.30000.70000.28280.01730.06570.63430.30510.00930.04340.64220.02360.87270.92020.0622
70.35000.65000.32930.02070.06300.58700.35210.01060.04020.59710.02440.88770.93250.0556
80.40000.60000.37590.02410.05630.54380.39750.01490.03470.55290.02520.90370.94110.0485
90.45000.55000.42460.02540.05330.49670.44650.01570.03150.50640.02620.91530.94990.0464
100.50000.50000.47180.02820.04750.45250.49040.01800.02890.46280.02550.92580.95430.0397
110.55000.45000.51810.03190.04270.40730.53440.02330.02640.41590.02610.93280.95560.0365
120.60000.40000.56550.03450.03770.36230.58030.02490.02290.37190.02540.94000.96060.0314
130.65000.35000.61240.03760.03270.31730.62400.02800.02110.32680.02480.94570.96220.0294
140.70000.30000.65930.04070.02860.27140.66800.03260.01990.27940.02460.95000.96230.0268
150.75000.25000.70540.04460.02420.22580.71130.03670.01820.23370.02440.95340.96300.0240
160.80000.20000.75280.04720.01920.18080.75640.03940.01560.18870.02340.95770.96510.0222
170.85000.15000.80070.04930.01430.13570.80040.04420.01470.14070.02140.96170.96460.0192
180.90000.10000.84780.05220.00940.09060.84450.04720.01270.09560.01910.96480.96580.0163
190.95000.05000.89450.05550.00500.04500.88830.05120.01120.04930.01700.96720.96610.0141
201.00000.00000.94210.05790.00000.00000.93060.04760.01150.01030.01090.97010.96910.0081
+
 
+
multiclass
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
basetrueestimerrors
01T0F1F0T1T0F1F0T1aef1_truef1_estimf1_dist
00.00001.00000.00000.00000.09490.90520.00080.00010.02020.97890.0375NaN0.0949NaN
10.05000.95000.04700.00300.09080.85920.04600.00010.03290.92090.03680.50950.73940.3362
20.10000.90000.09400.00600.08670.81330.09710.00010.03790.86500.03580.67480.84160.2255
30.15000.85000.14100.00900.08170.76830.14590.00010.04520.80880.03420.75930.86260.1647
40.20000.80000.18820.01180.07610.72380.19850.00010.04990.75150.03240.81210.88920.1246
50.25000.75000.23600.01400.07070.67940.25190.00010.05110.69700.03180.84910.90770.0996
60.30000.70000.28280.01730.06570.63430.30420.00010.05130.64440.03190.87270.92160.0832
70.35000.65000.32930.02070.06300.58700.36060.00010.05390.58540.03500.88770.92980.0756
80.40000.60000.37590.02410.05630.54380.40700.00010.05800.53490.03650.90370.93260.0666
90.45000.55000.42460.02540.05330.49670.46520.00010.05740.47730.03880.91530.94120.0588
100.50000.50000.47180.02820.04750.45250.51590.00010.06050.42350.04170.92580.94390.0526
110.55000.45000.51810.03190.04270.40730.56810.00010.05740.37440.04370.93280.95110.0467
120.60000.40000.56550.03450.03770.36230.62110.00010.05520.32360.04630.94000.95680.0426
130.65000.35000.61240.03760.03270.31730.67100.00010.05750.27140.04960.94570.95820.0385
140.70000.30000.65930.04070.02860.27140.72400.00010.05410.22170.05150.95000.96340.0345
150.75000.25000.70540.04460.02420.22580.77500.00010.04760.17730.05230.95340.96970.0337
160.80000.20000.75280.04720.01920.18080.82120.00010.04690.13180.05260.95770.97170.0296
170.85000.15000.80070.04930.01430.13570.86730.00010.04430.08820.05240.96170.97450.0272
180.90000.10000.84780.05220.00940.09060.91270.00010.03660.05060.04890.96480.97990.0250
190.95000.05000.89450.05550.00500.04500.95150.00010.02750.02080.04230.96720.98540.0235
201.00000.00000.94210.05790.00000.00000.97620.00010.01900.00470.03010.97010.99010.0222
+ + \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 7988285..c1e99a5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -100,6 +100,78 @@ mypy = ["contourpy[bokeh]", "docutils-stubs", "mypy (==0.991)", "types-Pillow"] test = ["Pillow", "matplotlib", "pytest"] test-no-images = ["pytest"] +[[package]] +name = "coverage" +version = "7.2.7" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "coverage-7.2.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8"}, + {file = "coverage-7.2.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb"}, + {file = "coverage-7.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6"}, + {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2"}, + {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063"}, + {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1"}, + {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353"}, + {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495"}, + {file = "coverage-7.2.7-cp310-cp310-win32.whl", hash = "sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818"}, + {file = "coverage-7.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850"}, + {file = "coverage-7.2.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f"}, + {file = "coverage-7.2.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe"}, + {file = "coverage-7.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3"}, + {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f"}, + {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb"}, + {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833"}, + {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97"}, + {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a"}, + {file = "coverage-7.2.7-cp311-cp311-win32.whl", hash = "sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a"}, + {file = "coverage-7.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562"}, + {file = "coverage-7.2.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4"}, + {file = "coverage-7.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4"}, + {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01"}, + {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6"}, + {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d"}, + {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de"}, + {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d"}, + {file = "coverage-7.2.7-cp312-cp312-win32.whl", hash = "sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511"}, + {file = "coverage-7.2.7-cp312-cp312-win_amd64.whl", hash = "sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3"}, + {file = "coverage-7.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f"}, + {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb"}, + {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9"}, + {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd"}, + {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a"}, + {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959"}, + {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02"}, + {file = "coverage-7.2.7-cp37-cp37m-win32.whl", hash = "sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f"}, + {file = "coverage-7.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0"}, + {file = "coverage-7.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5"}, + {file = "coverage-7.2.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5"}, + {file = "coverage-7.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9"}, + {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6"}, + {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e"}, + {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050"}, + {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5"}, + {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f"}, + {file = "coverage-7.2.7-cp38-cp38-win32.whl", hash = "sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e"}, + {file = "coverage-7.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c"}, + {file = "coverage-7.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9"}, + {file = "coverage-7.2.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2"}, + {file = "coverage-7.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7"}, + {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e"}, + {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1"}, + {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9"}, + {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250"}, + {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2"}, + {file = "coverage-7.2.7-cp39-cp39-win32.whl", hash = "sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb"}, + {file = "coverage-7.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27"}, + {file = "coverage-7.2.7-pp37.pp38.pp39-none-any.whl", hash = "sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d"}, + {file = "coverage-7.2.7.tar.gz", hash = "sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59"}, +] + +[package.extras] +toml = ["tomli"] + [[package]] name = "cycler" version = "0.11.0" @@ -147,6 +219,23 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "jinja2" +version = "3.1.2" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, + {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + [[package]] name = "joblib" version = "1.2.0" @@ -235,6 +324,65 @@ files = [ {file = "kiwisolver-1.4.4.tar.gz", hash = "sha256:d41997519fcba4a1e46eb4a2fe31bc12f0ff957b2b81bac28db24744f333e955"}, ] +[[package]] +name = "markupsafe" +version = "2.1.3" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"}, + {file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, + {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"}, + {file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"}, + {file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"}, + {file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"}, + {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"}, +] + [[package]] name = "matplotlib" version = "3.7.1" @@ -504,6 +652,65 @@ files = [ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +[[package]] +name = "pyarrow" +version = "12.0.1" +description = "Python library for Apache Arrow" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyarrow-12.0.1-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:6d288029a94a9bb5407ceebdd7110ba398a00412c5b0155ee9813a40d246c5df"}, + {file = "pyarrow-12.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:345e1828efdbd9aa4d4de7d5676778aba384a2c3add896d995b23d368e60e5af"}, + {file = "pyarrow-12.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d6009fdf8986332b2169314da482baed47ac053311c8934ac6651e614deacd6"}, + {file = "pyarrow-12.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d3c4cbbf81e6dd23fe921bc91dc4619ea3b79bc58ef10bce0f49bdafb103daf"}, + {file = "pyarrow-12.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:cdacf515ec276709ac8042c7d9bd5be83b4f5f39c6c037a17a60d7ebfd92c890"}, + {file = "pyarrow-12.0.1-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:749be7fd2ff260683f9cc739cb862fb11be376de965a2a8ccbf2693b098db6c7"}, + {file = "pyarrow-12.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6895b5fb74289d055c43db3af0de6e16b07586c45763cb5e558d38b86a91e3a7"}, + {file = "pyarrow-12.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1887bdae17ec3b4c046fcf19951e71b6a619f39fa674f9881216173566c8f718"}, + {file = "pyarrow-12.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2c9cb8eeabbadf5fcfc3d1ddea616c7ce893db2ce4dcef0ac13b099ad7ca082"}, + {file = "pyarrow-12.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:ce4aebdf412bd0eeb800d8e47db854f9f9f7e2f5a0220440acf219ddfddd4f63"}, + {file = "pyarrow-12.0.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:e0d8730c7f6e893f6db5d5b86eda42c0a130842d101992b581e2138e4d5663d3"}, + {file = "pyarrow-12.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:43364daec02f69fec89d2315f7fbfbeec956e0d991cbbef471681bd77875c40f"}, + {file = "pyarrow-12.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:051f9f5ccf585f12d7de836e50965b3c235542cc896959320d9776ab93f3b33d"}, + {file = "pyarrow-12.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:be2757e9275875d2a9c6e6052ac7957fbbfc7bc7370e4a036a9b893e96fedaba"}, + {file = "pyarrow-12.0.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:cf812306d66f40f69e684300f7af5111c11f6e0d89d6b733e05a3de44961529d"}, + {file = "pyarrow-12.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:459a1c0ed2d68671188b2118c63bac91eaef6fc150c77ddd8a583e3c795737bf"}, + {file = "pyarrow-12.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85e705e33eaf666bbe508a16fd5ba27ca061e177916b7a317ba5a51bee43384c"}, + {file = "pyarrow-12.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9120c3eb2b1f6f516a3b7a9714ed860882d9ef98c4b17edcdc91d95b7528db60"}, + {file = "pyarrow-12.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:c780f4dc40460015d80fcd6a6140de80b615349ed68ef9adb653fe351778c9b3"}, + {file = "pyarrow-12.0.1-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:a3c63124fc26bf5f95f508f5d04e1ece8cc23a8b0af2a1e6ab2b1ec3fdc91b24"}, + {file = "pyarrow-12.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b13329f79fa4472324f8d32dc1b1216616d09bd1e77cfb13104dec5463632c36"}, + {file = "pyarrow-12.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb656150d3d12ec1396f6dde542db1675a95c0cc8366d507347b0beed96e87ca"}, + {file = "pyarrow-12.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6251e38470da97a5b2e00de5c6a049149f7b2bd62f12fa5dbb9ac674119ba71a"}, + {file = "pyarrow-12.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:3de26da901216149ce086920547dfff5cd22818c9eab67ebc41e863a5883bac7"}, + {file = "pyarrow-12.0.1.tar.gz", hash = "sha256:cce317fc96e5b71107bf1f9f184d5e54e2bd14bbf3f9a3d62819961f0af86fec"}, +] + +[package.dependencies] +numpy = ">=1.16.6" + +[[package]] +name = "pylance" +version = "0.5.9" +description = "python wrapper for lance-rs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pylance-0.5.9-cp38-abi3-macosx_10_15_x86_64.whl", hash = "sha256:6d5395f8a400caa152b9dc8d1f979b67c3003cbe54e038a53b33127f9a0c96da"}, + {file = "pylance-0.5.9-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:b099a7fa01a96dc6a3d7413890a3c06c6837563100f6e71311916dbd24f1b26e"}, + {file = "pylance-0.5.9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:293520fada417e653085118d296ba011024ad0cfbbb1e60ee025b14aae2c0178"}, + {file = "pylance-0.5.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22bbb04024302996268bef98e190d62960f62293e2b5606be276d801cdfb13f3"}, + {file = "pylance-0.5.9-cp38-abi3-win_amd64.whl", hash = "sha256:810d4020a65b8d001352cc69c751602412f73c498b1ac0cdb408f00cb493a2b6"}, +] + +[package.dependencies] +numpy = ">=1.22" +pandas = ">=1.4" +pyarrow = ">=10" + +[package.extras] +tests = ["duckdb", "ml_dtypes", "polars[pandas,pyarrow]", "pytest"] + [[package]] name = "pyparsing" version = "3.0.9" @@ -538,6 +745,41 @@ pluggy = ">=0.12,<2.0" [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-cov" +version = "4.1.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, + {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] + +[[package]] +name = "pytest-mock" +version = "3.11.1" +description = "Thin-wrapper around the mock package for easier use with pytest" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-mock-3.11.1.tar.gz", hash = "sha256:7f6b125602ac6d743e523ae0bfa71e1a697a2f5534064528c6ff84c2f7c2fc7f"}, + {file = "pytest_mock-3.11.1-py3-none-any.whl", hash = "sha256:21c279fff83d70763b05f8874cc9cfb3fcacd6d354247a976f9529d19f9acf39"}, +] + +[package.dependencies] +pytest = ">=5.0" + +[package.extras] +dev = ["pre-commit", "pytest-asyncio", "tox"] + [[package]] name = "python-dateutil" version = "2.8.2" @@ -735,4 +977,4 @@ test = ["pytest", "pytest-cov"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "834ffb619893a1fb006e1b5a3213cc772117c9000e719b95a4478f74fd5d0066" +content-hash = "72e3afd9a24b88fc8a8f5f55e1c408f65090fce9015a442f6f41638191276b6f" diff --git a/pyproject.toml b/pyproject.toml index a6297fd..49bfad4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,13 +9,21 @@ readme = "README.md" python = "^3.11" quapy = "^0.1.7" pandas = "^2.0.3" +jinja2 = "^3.1.2" [tool.poetry.scripts] -main = "quacc.main:main" +multi = "quacc.main:estimate_multiclass" +bin = "quacc.main:estimate_binary" [tool.poetry.group.dev.dependencies] pytest = "^7.4.0" +pylance = "^0.5.9" +pytest-mock = "^3.11.1" +pytest-cov = "^4.1.0" + +[tool.pytest.ini_options] +addopts = "--cov=quacc" [build-system] requires = ["poetry-core"] diff --git a/quacc/data.py b/quacc/data.py index 8f9b53c..fd1e3c3 100644 --- a/quacc/data.py +++ b/quacc/data.py @@ -46,36 +46,77 @@ class ExtendedCollection(LabelledCollection): def split_by_pred(self): _ncl = int(math.sqrt(self.n_classes)) - _indexes = ExtendedCollection.split_index_by_pred(_ncl, self.instances) - return [ - ExtendedCollection( - self.instances[ind] if len(ind) > 0 else np.asarray([], dtype=int), - np.asarray( - [ - ExClassManager.get_true(_ncl, lbl) - for lbl in (self.labels[ind] if len(ind) > 0 else []) - ], - dtype=int, - ), - classes=range(0, _ncl), + _indexes = ExtendedCollection._split_index_by_pred(_ncl, self.instances) + if isinstance(self.instances, np.ndarray): + _instances = [ + self.instances[ind] if ind.shape[0] > 0 else np.asarray([], dtype=int) + for ind in _indexes + ] + elif isinstance(self.instances, sp.csr_matrix): + _instances = [ + self.instances[ind] + if ind.shape[0] > 0 + else sp.csr_matrix(np.empty((0, 0), dtype=int)) + for ind in _indexes + ] + _labels = [ + np.asarray( + [ + ExClassManager.get_true(_ncl, lbl) + for lbl in (self.labels[ind] if len(ind) > 0 else []) + ], + dtype=int, ) for ind in _indexes ] + return [ + ExtendedCollection(inst, lbl, classes=range(0, _ncl)) + for (inst, lbl) in zip(_instances, _labels) + ] @classmethod - def split_index_by_pred( - cls, n_classes: int, instances: np.ndarray + def split_inst_by_pred( + cls, n_classes: int, instances: np.ndarray | sp.csr_matrix + ) -> (List[np.ndarray | sp.csr_matrix], List[float]): + _indexes = cls._split_index_by_pred(n_classes, instances) + if isinstance(instances, np.ndarray): + _instances = [ + instances[ind] if ind.shape[0] > 0 else np.asarray([], dtype=int) + for ind in _indexes + ] + elif isinstance(instances, sp.csr_matrix): + _instances = [ + instances[ind] + if ind.shape[0] > 0 + else sp.csr_matrix(np.empty((0, 0), dtype=int)) + for ind in _indexes + ] + norms = [inst.shape[0] / instances.shape[0] for inst in _instances] + return _instances, norms + + @classmethod + def _split_index_by_pred( + cls, n_classes: int, instances: np.ndarray | sp.csr_matrix ) -> List[np.ndarray]: - _pred_label = [np.argmax(inst[-n_classes:], axis=0) for inst in instances] + if isinstance(instances, np.ndarray): + _pred_label = [np.argmax(inst[-n_classes:], axis=0) for inst in instances] + elif isinstance(instances, sp.csr_matrix): + _pred_label = [ + np.argmax(inst[:, -n_classes:].toarray().flatten(), axis=0) + for inst in instances + ] + else: + raise ValueError("Unsupported matrix format") + return [ - np.asarray([j for (j, x) in enumerate(_pred_label) if x == i]) + np.asarray([j for (j, x) in enumerate(_pred_label) if x == i], dtype=int) for i in range(0, n_classes) ] @classmethod def extend_instances( - cls, instances: np.ndarray, pred_proba: np.ndarray - ) -> np.ndarray: + cls, instances: np.ndarray | sp.csr_matrix, pred_proba: np.ndarray + ) -> np.ndarray | sp.csr_matrix: if isinstance(instances, sp.csr_matrix): _pred_proba = sp.csr_matrix(pred_proba) n_x = sp.hstack([instances, _pred_proba]) diff --git a/quacc/error.py b/quacc/error.py index e8d315a..90e5701 100644 --- a/quacc/error.py +++ b/quacc/error.py @@ -3,13 +3,12 @@ import quapy as qp def from_name(err_name): if err_name == 'f1e': return f1e + elif err_name == 'f1': + return f1 else: return qp.error.from_name(err_name) -def f1e(prev): - return 1 - f1_score(prev) - -def f1_score(prev): +def f1(prev): # https://github.com/dice-group/gerbil/wiki/Precision,-Recall-and-F1-measure if prev[0] == 0 and prev[1] == 0 and prev[2] == 0: return 1.0 @@ -21,3 +20,6 @@ def f1_score(prev): recall = prev[0] / (prev[0] + prev[1]) precision = prev[0] / (prev[0] + prev[2]) return 2 * (precision * recall) / (precision + recall) + +def f1e(prev): + return 1 - f1(prev) diff --git a/quacc/estimator.py b/quacc/estimator.py index 5152b36..2fccfe1 100644 --- a/quacc/estimator.py +++ b/quacc/estimator.py @@ -11,17 +11,10 @@ from sklearn.model_selection import cross_val_predict from quacc.data import ExtendedCollection as EC -def _check_prevalence_classes(true_classes, estim_classes, estim_prev): - for _cls in true_classes: - if _cls not in estim_classes: - estim_prev = np.insert(estim_prev, _cls, [0.0], axis=0) - return estim_prev - - class AccuracyEstimator: def extend(self, base: LabelledCollection, pred_proba=None) -> EC: if not pred_proba: - pred_proba = self.model.predict_proba(base.X) + pred_proba = self.c_model.predict_proba(base.X) return EC.extend_collection(base, pred_proba) @abstractmethod @@ -62,10 +55,16 @@ class MulticlassAccuracyEstimator(AccuracyEstimator): estim_prev = self.q_model.quantify(e_inst) - return _check_prevalence_classes( + return self._check_prevalence_classes( self.e_train.classes_, self.q_model.classes_, estim_prev ) + def _check_prevalence_classes(self, true_classes, estim_classes, estim_prev): + for _cls in true_classes: + if _cls not in estim_classes: + estim_prev = np.insert(estim_prev, _cls, [0.0], axis=0) + return estim_prev + class BinaryQuantifierAccuracyEstimator(AccuracyEstimator): def __init__(self, c_model: BaseEstimator): @@ -86,10 +85,11 @@ class BinaryQuantifierAccuracyEstimator(AccuracyEstimator): else: self.e_train = train + self.n_classes = self.e_train.n_classes [e_train_0, e_train_1] = self.e_train.split_by_pred() - self.q_model_0.fit(self.e_train_0) - self.q_model_1.fit(self.e_train_1) + self.q_model_0.fit(e_train_0) + self.q_model_1.fit(e_train_1) def estimate(self, instances, ext=False): # TODO: test @@ -99,17 +99,24 @@ class BinaryQuantifierAccuracyEstimator(AccuracyEstimator): else: e_inst = instances - _ncl = int(math.sqrt(self.e_train.n_classes)) - [e_inst_0, e_inst_1] = [ - e_inst[ind] for ind in EC.split_index_by_pred(_ncl, e_inst) + _ncl = int(math.sqrt(self.n_classes)) + s_inst, norms = EC.split_inst_by_pred(_ncl, e_inst) + [estim_prev_0, estim_prev_1] = [ + self._quantify_helper(inst, norm, q_model) + for (inst, norm, q_model) in zip( + s_inst, norms, [self.q_model_0, self.q_model_1] + ) ] - estim_prev_0 = self.q_model_0.quantify(e_inst_0) - estim_prev_1 = self.q_model_1.quantify(e_inst_1) estim_prev = [] for prev_row in zip(estim_prev_0, estim_prev_1): for prev in prev_row: estim_prev.append(prev) - return estim_prev + return np.asarray(estim_prev) + def _quantify_helper(self, inst, norm, q_model): + if inst.shape[0] > 0: + return np.asarray(list(map(lambda p: p * norm, q_model.quantify(inst)))) + else: + return np.asarray([0.0, 0.0]) diff --git a/quacc/evaluation.py b/quacc/evaluation.py index cbce5af..48502d4 100644 --- a/quacc/evaluation.py +++ b/quacc/evaluation.py @@ -104,7 +104,7 @@ def evaluation_report( base_prevs, true_prevs, estim_prevs = estimate(estimator, protocol) if error_metrics == "all": - error_metrics = ["mae", "rae", "mrae", "kld", "nkld", "f1e"] + error_metrics = ["ae", "f1"] error_funcs = [ error.from_name(e) if isinstance(e, str) else e for e in error_metrics @@ -112,6 +112,9 @@ def evaluation_report( assert all(hasattr(e, "__call__") for e in error_funcs), "invalid error function" error_names = [e.__name__ for e in error_funcs] error_cols = error_names.copy() + if "f1" in error_cols: + error_cols.remove("f1") + error_cols.extend(["f1_true", "f1_estim", "f1_dist"]) if "f1e" in error_cols: error_cols.remove("f1e") error_cols.extend(["f1e_true", "f1e_estim"]) @@ -136,6 +139,12 @@ def evaluation_report( series[("errors", "f1e_true")] = error_metric(true_prev) series[("errors", "f1e_estim")] = error_metric(estim_prev) continue + if error_name == "f1": + f1_true, f1_estim = error_metric(true_prev), error_metric(estim_prev) + series[("errors", "f1_true")] = f1_true + series[("errors", "f1_estim")] = f1_estim + series[("errors", "f1_dist")] = abs(f1_estim - f1_true) + continue score = error_metric(true_prev, estim_prev) series[("errors", error_name)] = score diff --git a/quacc/main.py b/quacc/main.py index b251549..f8e14aa 100644 --- a/quacc/main.py +++ b/quacc/main.py @@ -4,7 +4,10 @@ from quapy.protocol import APP from sklearn.linear_model import LogisticRegression import quacc.evaluation as eval -from quacc.estimator import MulticlassAccuracyEstimator +from quacc.estimator import ( + BinaryQuantifierAccuracyEstimator, + MulticlassAccuracyEstimator, +) from quacc.data import get_dataset @@ -12,8 +15,11 @@ qp.environ["SAMPLE_SIZE"] = 100 pd.set_option("display.float_format", "{:.4f}".format) +dataset_name = "imdb" -def test_2(dataset_name): + +def estimate_multiclass(): + print(dataset_name) train, test = get_dataset(dataset_name) model = LogisticRegression() @@ -45,19 +51,52 @@ def test_2(dataset_name): protocol, aggregate=True, ) + # print(df.to_latex()) print(df.to_string()) + # print(df.to_html()) + print() -def main(): - for dataset_name in [ - "imdb", - # "hp", - # "spambase", - ]: - print(dataset_name) - test_2(dataset_name) - print("*" * 50) +def estimate_binary(): + print(dataset_name) + train, test = get_dataset(dataset_name) + + model = LogisticRegression() + + print(f"fitting model {model.__class__.__name__}...", end=" ", flush=True) + model.fit(*train.Xy) + print("fit") + + estimator = BinaryQuantifierAccuracyEstimator(model) + + print( + f"fitting qmodel {estimator.q_model_0.__class__.__name__}...", + end=" ", + flush=True, + ) + estimator.fit(train) + print("fit") + + n_prevalences = 21 + repreats = 1000 + protocol = APP(test, n_prevalences=n_prevalences, repeats=repreats) + print( + f"Tests:\n\ + protocol={protocol.__class__.__name__}\n\ + n_prevalences={n_prevalences}\n\ + repreats={repreats}\n\ + executing...\n" + ) + df = eval.evaluation_report( + estimator, + protocol, + aggregate=True, + ) + # print(df.to_latex(float_format="{:.4f}".format)) + print(df.to_string()) + # print(df.to_html()) + print() if __name__ == "__main__": - main() + estimate_multiclass() diff --git a/tests/test_data.py b/tests/test_data.py index 8bc8c0f..d8e6b3c 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,6 +1,7 @@ import pytest from quacc.data import ExClassManager as ECM, ExtendedCollection import numpy as np +import scipy.sparse as sp class TestExClassManager: @@ -45,50 +46,180 @@ class TestExClassManager: class TestExtendedCollection: + @pytest.mark.parametrize( + "instances,result", + [ + ( + np.asarray( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + [np.asarray([1, 3]), np.asarray([0, 2])], + ), + ( + sp.csr_matrix( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + [np.asarray([1, 3]), np.asarray([0, 2])], + ), + ( + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + [np.asarray([], dtype=int), np.asarray([0, 1])], + ), + ( + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + [np.asarray([], dtype=int), np.asarray([0, 1])], + ), + ( + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + [np.asarray([0, 1]), np.asarray([], dtype=int)], + ), + ( + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + [np.asarray([0, 1]), np.asarray([], dtype=int)], + ), + ], + ) + def test__split_index_by_pred(self, instances, result): + ncl = 2 + assert all( + np.array_equal(a, b) + for (a, b) in zip( + ExtendedCollection._split_index_by_pred(ncl, instances), + result, + ) + ) + + @pytest.mark.parametrize( + "instances,s_inst,norms", + [ + ( + np.asarray( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + [ + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + ], + [0.5, 0.5], + ), + ( + sp.csr_matrix( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + [ + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + ], + [0.5, 0.5], + ), + ( + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + [ + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([], dtype=int), + ], + [1.0, 0.0], + ), + ( + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + [ + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + sp.csr_matrix([], dtype=int), + ], + [1.0, 0.0], + ), + ( + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + [ + np.asarray([], dtype=int), + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + ], + [0.0, 1.0], + ), + ( + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + [ + sp.csr_matrix([], dtype=int), + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + ], + [0.0, 1.0], + ), + ], + ) + def test_split_inst_by_pred(self, instances, s_inst, norms): + ncl = 2 + _s_inst, _norms = ExtendedCollection.split_inst_by_pred(ncl, instances) + if isinstance(s_inst, np.ndarray): + assert all(np.array_equal(a, b) for (a, b) in zip(_s_inst, s_inst)) + if isinstance(s_inst, sp.csr_matrix): + assert all((a != b).nnz == 0 for (a, b) in zip(_s_inst, s_inst)) + assert all(a == b for (a, b) in zip(_norms, norms)) + @pytest.mark.parametrize( "instances,labels,inst0,lbl0,inst1,lbl1", [ ( - [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]], - [3, 0, 1, 2], - [[1, 0.54, 0.46], [3, 0.6, 0.4]], - [0, 1], - [[0, 0.3, 0.7], [2, 0.28, 0.72]], - [1, 0], + np.asarray( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + np.asarray([3, 0, 1, 2]), + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 1]), + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([1, 0]), ), ( - [[0, 0.3, 0.7], [2, 0.28, 0.72]], - [3, 1], - [], - [], - [[0, 0.3, 0.7], [2, 0.28, 0.72]], - [1, 0], + sp.csr_matrix( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + np.asarray([3, 0, 1, 2]), + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 1]), + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([1, 0]), ), ( - [[1, 0.54, 0.46], [3, 0.6, 0.4]], - [0, 2], - [[1, 0.54, 0.46], [3, 0.6, 0.4]], - [0, 1], - [], - [], + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([3, 1]), + np.asarray([], dtype=int), + np.asarray([], dtype=int), + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([1, 0]), + ), + ( + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([3, 1]), + sp.csr_matrix(np.empty((0, 0), dtype=int)), + np.asarray([], dtype=int), + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([1, 0]), + ), + ( + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 2]), + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 1]), + np.asarray([], dtype=int), + np.asarray([], dtype=int), + ), + ( + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 2]), + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0, 1]), + sp.csr_matrix(np.empty((0, 0), dtype=int)), + np.asarray([], dtype=int), ), - ], ) def test_split_by_pred(self, instances, labels, inst0, lbl0, inst1, lbl1): - ec = ExtendedCollection( - np.asarray(instances), np.asarray(labels), classes=range(0, 4) - ) + ec = ExtendedCollection(instances, labels, classes=range(0, 4)) [ec0, ec1] = ec.split_by_pred() - print(ec0.X, np.asarray(inst0)) - assert( np.array_equal(ec0.X, np.asarray(inst0)) ) - print(ec0.y, np.asarray(lbl0)) - assert( np.array_equal(ec0.y, np.asarray(lbl0)) ) - print(ec1.X, np.asarray(inst1)) - assert( np.array_equal(ec1.X, np.asarray(inst1)) ) - print(ec1.y, np.asarray(lbl1)) - assert( np.array_equal(ec1.y, np.asarray(lbl1)) ) - - - - + if isinstance(instances, np.ndarray): + assert np.array_equal(ec0.X, inst0) + assert np.array_equal(ec1.X, inst1) + if isinstance(instances, sp.csr_matrix): + assert (ec0.X != inst0).nnz == 0 + assert (ec1.X != inst1).nnz == 0 + assert np.array_equal(ec0.y, lbl0) + assert np.array_equal(ec1.y, lbl1) diff --git a/tests/test_estimator.py b/tests/test_estimator.py index 190b0ba..d13afe2 100644 --- a/tests/test_estimator.py +++ b/tests/test_estimator.py @@ -1,4 +1,66 @@ -class TestBinaryQuantifierAccuracyEstimator: +import pytest +import numpy as np +import scipy.sparse as sp +from sklearn.linear_model import LogisticRegression - def test_estimate(self): - pass \ No newline at end of file +from quacc.estimator import BinaryQuantifierAccuracyEstimator + + +class TestBinaryQuantifierAccuracyEstimator: + @pytest.mark.parametrize( + "instances,preds0,preds1,result", + [ + ( + np.asarray( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.15, 0.2, 0.35, 0.3]), + ), + ( + sp.csr_matrix( + [[0, 0.3, 0.7], [1, 0.54, 0.46], [2, 0.28, 0.72], [3, 0.6, 0.4]] + ), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.15, 0.2, 0.35, 0.3]), + ), + ( + np.asarray([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.0, 0.4, 0.0, 0.6]), + ), + ( + sp.csr_matrix([[0, 0.3, 0.7], [2, 0.28, 0.72]]), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.0, 0.4, 0.0, 0.6]), + ), + ( + np.asarray([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.3, 0.0, 0.7, 0.0]), + ), + ( + sp.csr_matrix([[1, 0.54, 0.46], [3, 0.6, 0.4]]), + np.asarray([0.3, 0.7]), + np.asarray([0.4, 0.6]), + np.asarray([0.3, 0.0, 0.7, 0.0]), + ), + ], + ) + def test_estimate_ndarray(self, mocker, instances, preds0, preds1, result): + estimator = BinaryQuantifierAccuracyEstimator(LogisticRegression()) + estimator.n_classes = 4 + with mocker.patch.object(estimator.q_model_0, "quantify"), mocker.patch.object( + estimator.q_model_1, "quantify" + ): + estimator.q_model_0.quantify.return_value = preds0 + estimator.q_model_1.quantify.return_value = preds1 + assert np.array_equal( + estimator.estimate(instances, ext=True), + result, + )