ecod-rs benchmark

ecod-rs is a Rust implementation of the ECOD outlier detector (Li et al., 2022) with Python bindings. Here it is compared with ECOD from PyOD.

Data is random normal noise of several sizes (rows x features) and the classical datasets from ADBench. Each dataset is split 60/40 into train and test. Every measurement runs in a fresh single-threaded process, times are taken over 5 runs.

What is measured:

Summary

How many times ecod-rs is faster than pyod-ECOD: median over all 53 datasets, the range in brackets. Below 1 means slower.

phasevarianttimes faster than pyod-ECOD
ECODInductiveECOD
fit×6.4 (2.7 to 20.5)×6.2 (2.7 to 19.9)
score×12.0 (5.4 to 23.6)×17.7 (9.7 to 42.3)
pipeline×9.4 (4.1 to 20.6)×10.6 (5.2 to 23.5)
savedefault×2.2 (0.4 to 6.2)×2.2 (0.4 to 5.8)
savecompressed×1.4 (0.3 to 19.3)×1.5 (0.3 to 19.5)
loaddefault×3.8 (0.5 to 9.9)×3.7 (0.5 to 9.6)
loadcompressed×29.9 (11.1 to 118.6)×30.1 (11.1 to 116.5)

Speed

Median time in seconds. In brackets, how many times faster than pyod-ECOD. PyOD has no separate convert step.

datasetfit, sscore, spipeline, sconvert, s
ECODInductiveECODpyod-ECODECODInductiveECODpyod-ECODECODInductiveECODpyod-ECODECODInductiveECOD
1000x100.0003146 (×5.6)0.0003185 (×5.6)0.0017730.0002783 (×7.5)0.0001734 (×12.0)0.0020880.0005905 (×5.9)0.0004792 (×7.3)0.0035120.000015760.00002044
10000x100.003258 (×3.1)0.00331 (×3.0)0.010010.002771 (×6.0)0.001646 (×10.1)0.01670.005986 (×4.7)0.004946 (×5.7)0.027970.000020880.00001961
100000x100.0391 (×3.6)0.04024 (×3.5)0.14030.0338 (×6.9)0.01898 (×12.2)0.23220.07202 (×5.2)0.05737 (×6.6)0.37580.000015840.00001632
1000000x100.4811 (×3.7)0.4644 (×3.8)1.760.3888 (×7.9)0.2056 (×14.9)3.0540.8921 (×5.3)0.6746 (×7.0)4.7230.000018290.00001699
10000x1000.03524 (×3.0)0.03489 (×3.0)0.10560.03265 (×5.4)0.01684 (×10.4)0.17510.06844 (×4.1)0.05331 (×5.3)0.2840.000017360.0000185
100000x1000.3991 (×3.6)0.3987 (×3.6)1.4370.3558 (×7.3)0.1835 (×14.1)2.5940.7502 (×5.4)0.5838 (×6.9)4.050.000015860.00001603
ADBench datasets
datasetfit, sscore, spipeline, sconvert, s
ECODInductiveECODpyod-ECODECODInductiveECODpyod-ECODECODInductiveECODpyod-ECODECODInductiveECOD
1_ALOI0.03444 (×5.7)0.03395 (×5.8)0.19650.02367 (×14.8)0.01646 (×21.3)0.35120.05822 (×9.4)0.05191 (×10.6)0.5480.000018980.0000175
2_annthyroid0.0008743 (×5.9)0.0008899 (×5.8)0.0052010.0006777 (×11.9)0.0004644 (×17.3)0.0080480.001547 (×8.3)0.001325 (×9.7)0.012890.000014920.00001687
3_backdoor0.3141 (×9.7)0.3151 (×9.7)3.0590.2757 (×19.5)0.1367 (×39.2)5.3640.592 (×14.3)0.4528 (×18.6)8.4440.000016480.00001515
4_breastw0.000119 (×13.5)0.0001213 (×13.3)0.0016090.00009787 (×18.3)0.00007337 (×24.4)0.001790.0002008 (×15.5)0.0001754 (×17.7)0.003110.000015280.0000156
5_campaign0.03771 (×9.6)0.04064 (×8.9)0.36110.02773 (×23.6)0.01915 (×34.1)0.65360.06571 (×15.6)0.05948 (×17.3)1.0270.000016240.00001649
6_cardio0.000812 (×5.7)0.0008217 (×5.6)0.0045950.0006845 (×10.1)0.0004569 (×15.2)0.0069430.001467 (×7.6)0.00125 (×9.0)0.01120.000014920.0000149
7_Cardiotocography0.0008516 (×5.9)0.0008667 (×5.8)0.0050460.0006999 (×11.2)0.0004848 (×16.2)0.0078590.001538 (×8.1)0.001309 (×9.5)0.012480.00001470.00001526
8_celeba0.1402 (×7.3)0.1431 (×7.1)1.0190.1189 (×15.3)0.06594 (×27.5)1.8160.2576 (×11.0)0.2076 (×13.6)2.8290.000015170.00001566
9_census3.417 (×8.2)3.447 (×8.1)27.922.642 (×18.3)1.144 (×42.3)48.395.753 (×13.2)4.29 (×17.8)76.180.000016280.00001541
10_cover0.06237 (×7.1)0.06583 (×6.7)0.44110.04394 (×17.2)0.03212 (×23.6)0.75690.1068 (×11.1)0.1006 (×11.8)1.1910.000018550.00001664
11_donors0.113 (×8.0)0.1115 (×8.1)0.89860.09629 (×20.2)0.05081 (×38.3)1.9470.2075 (×13.6)0.1671 (×16.9)2.8310.0000160.00001875
12_fault0.001358 (×3.9)0.001371 (×3.8)0.0052610.001166 (×7.4)0.0007633 (×11.2)0.0085780.002477 (×5.5)0.002098 (×6.4)0.013530.000019260.00001738
13_fraud0.3704 (×3.9)0.3732 (×3.9)1.440.3085 (×8.0)0.1674 (×14.8)2.4780.6766 (×5.8)0.546 (×7.1)3.9040.000016770.00001739
14_glass0.00006568 (×16.8)0.00006481 (×17.0)0.0011040.00005911 (×16.3)0.00004068 (×23.7)0.0009660.0001123 (×15.3)0.00009516 (×18.1)0.0017190.000016180.00001671
15_Hepatitis0.00006171 (×17.4)0.000059 (×18.2)0.0010760.00005122 (×18.0)0.00003865 (×23.9)0.00092360.0000985 (×17.2)0.00008304 (×20.4)0.0016920.000016350.00001816
16_http0.04223 (×7.5)0.04245 (×7.4)0.31530.03111 (×17.8)0.01958 (×28.3)0.55370.07468 (×11.8)0.06295 (×14.0)0.87970.000017310.00001818
17_InternetAds0.0562 (×7.5)0.05586 (×7.6)0.42290.03364 (×21.9)0.02375 (×31.0)0.73730.09682 (×12.1)0.07627 (×15.4)1.1750.000015570.00001704
18_Ionosphere0.0003089 (×5.6)0.0003141 (×5.5)0.0017160.0002777 (×7.2)0.0001739 (×11.5)0.0019970.000571 (×5.8)0.0004783 (×6.9)0.0032840.000017870.00001887
19_landsat0.003861 (×5.4)0.004241 (×4.9)0.020930.003537 (×12.0)0.002216 (×19.1)0.042350.007087 (×9.8)0.006443 (×10.8)0.069660.000016220.00001704
20_letter0.0007171 (×7.7)0.000736 (×7.5)0.0055080.0005887 (×13.3)0.000443 (×17.7)0.0078360.00129 (×10.0)0.001113 (×11.6)0.012890.000015880.00001587
21_Lymphography0.000066 (×18.0)0.00006727 (×17.6)0.0011860.00006432 (×18.3)0.00004162 (×28.3)0.0011770.0001135 (×17.4)0.00009758 (×20.2)0.001970.000019320.00001737
22_magic.gamma0.006371 (×3.2)0.006515 (×3.1)0.020250.005375 (×6.6)0.003252 (×10.8)0.035250.01179 (×5.2)0.009671 (×6.3)0.060830.000017230.000018
23_mammography0.001409 (×6.4)0.001431 (×6.3)0.0090780.001157 (×12.4)0.0007776 (×18.5)0.014390.002551 (×9.7)0.002185 (×11.3)0.024790.00001690.00001568
24_mnist0.01096 (×7.2)0.01187 (×6.6)0.078440.008951 (×16.1)0.005628 (×25.6)0.14430.01984 (×11.7)0.0168 (×13.8)0.23240.000016820.00002205
25_musk0.01268 (×3.4)0.01285 (×3.3)0.042520.0105 (×8.1)0.006463 (×13.1)0.084590.0232 (×6.1)0.01902 (×7.4)0.14160.000017330.00001556
26_optdigits0.005102 (×6.7)0.005073 (×6.7)0.034180.003592 (×17.0)0.002533 (×24.1)0.061110.008243 (×13.8)0.007449 (×15.3)0.11380.000018030.00001492
27_PageBlocks0.001446 (×4.5)0.001485 (×4.3)0.0064480.001196 (×8.5)0.0007582 (×13.4)0.010190.002631 (×6.1)0.002209 (×7.3)0.016150.000015990.00001585
28_pendigits0.002974 (×3.9)0.003021 (×3.8)0.011480.00255 (×7.3)0.00156 (×11.9)0.018590.005532 (×5.8)0.004546 (×7.1)0.032090.000015660.00001617
29_Pima0.0001735 (×8.4)0.0001769 (×8.2)0.0014560.0001504 (×10.9)0.0001006 (×16.4)0.0016470.0003102 (×9.0)0.0002645 (×10.6)0.0028040.000016020.0000157
30_satellite0.00392 (×5.4)0.004187 (×5.0)0.021090.003474 (×11.0)0.002259 (×16.9)0.038120.006975 (×9.4)0.006311 (×10.4)0.065630.000015950.00001627
31_satimage-20.003643 (×5.3)0.003708 (×5.2)0.019160.003088 (×10.9)0.002001 (×16.8)0.033610.00674 (×8.7)0.005621 (×10.4)0.058340.000015290.0000161
32_shuttle0.006336 (×8.5)0.00656 (×8.2)0.053770.004984 (×20.6)0.003515 (×29.2)0.10260.01135 (×14.8)0.00998 (×16.9)0.16860.000015390.0000146
33_skin0.01439 (×6.7)0.01457 (×6.6)0.095920.01021 (×16.5)0.007724 (×21.9)0.16880.02447 (×11.4)0.02158 (×13.0)0.27980.000015830.00001522
34_smtp0.00603 (×6.1)0.006032 (×6.1)0.036540.004356 (×15.2)0.00295 (×22.5)0.066250.01025 (×10.7)0.009003 (×12.2)0.10960.000014190.0000158
35_SpamBase0.004433 (×6.7)0.004539 (×6.5)0.029630.003559 (×15.4)0.00229 (×24.0)0.054930.007909 (×11.8)0.006798 (×13.7)0.09310.000017040.00001634
36_speech0.04522 (×2.7)0.04549 (×2.7)0.12270.03928 (×6.1)0.02322 (×10.3)0.23810.08405 (×4.5)0.06871 (×5.5)0.37840.000014960.00001542
37_Stamps0.0001064 (×11.1)0.0001087 (×10.9)0.0011820.00009418 (×12.2)0.00006132 (×18.7)0.0011490.0001871 (×10.9)0.0001557 (×13.1)0.0020360.000015480.00001521
38_thyroid0.0005032 (×6.4)0.0005135 (×6.2)0.0032040.0004116 (×11.4)0.000276 (×17.0)0.0047010.0008994 (×8.4)0.0007643 (×9.9)0.007550.000016560.00001643
39_vertebral0.00006213 (×17.4)0.00006428 (×16.8)0.0010810.00005554 (×16.8)0.00003741 (×24.9)0.00093240.0001051 (×16.1)0.00008861 (×19.1)0.0016890.000014940.00001538
40_vowels0.0005325 (×4.2)0.0005477 (×4.1)0.0022450.0004747 (×6.4)0.000286 (×10.6)0.0030290.0009977 (×5.0)0.0008122 (×6.1)0.0049840.000015830.00001525
41_Waveform0.00223 (×3.2)0.002264 (×3.1)0.0070830.001863 (×6.1)0.001168 (×9.7)0.011360.004083 (×4.3)0.003398 (×5.2)0.017620.00001540.00001549
42_WBC0.0000551 (×20.5)0.00005659 (×19.9)0.0011290.00004742 (×21.6)0.00003672 (×27.9)0.0010240.00008944 (×20.6)0.00007818 (×23.5)0.0018410.000015430.00001631
43_WDBC0.0003259 (×5.1)0.0003332 (×4.9)0.0016490.0002985 (×6.9)0.0001881 (×11.0)0.0020710.0006168 (×5.6)0.0005153 (×6.6)0.0034250.000015150.0000161
44_Wilt0.0008005 (×4.2)0.0008062 (×4.2)0.0033860.0006907 (×7.1)0.000421 (×11.6)0.0049040.001478 (×5.4)0.001221 (×6.5)0.0079710.000016210.00001654
45_wine0.00006933 (×15.5)0.00006972 (×15.4)0.0010770.00006283 (×15.5)0.00004305 (×22.6)0.00097330.0001226 (×14.5)0.0001002 (×17.8)0.0017790.000014910.0000176
46_WPBC0.0002048 (×6.7)0.000209 (×6.6)0.001370.0001904 (×7.7)0.0001184 (×12.4)0.0014720.0003702 (×6.8)0.0003164 (×8.0)0.0025270.000015210.00001562
47_yeast0.0002472 (×8.7)0.000251 (×8.6)0.0021620.0002031 (×13.9)0.0001368 (×20.6)0.0028240.0004328 (×10.7)0.0003748 (×12.4)0.0046450.000015030.00001652

Memory

How much the process memory peak grew during the run, in MB.

datasetfit, MBscore, MB
ECODInductiveECODpyod-ECODECODInductiveECODpyod-ECOD
1000x100.046880.0585950.110.078120.011720.3555
10000x100.70310.687552.780.80860.12113.812
100000x106.8836.86773.356.7421.22744.89
1000000x1067.6468.57279.176.1113.78407
10000x1004.7814.80973.376.6760.121138.05
100000x10048.0748.07279.875.251.227412.8
ADBench datasets
datasetfit, MBscore, MB
ECODInductiveECODpyod-ECODECODInductiveECODpyod-ECOD
1_ALOI6.8056.80180.4910.430.601660.32
2_annthyroid0.01562049.960.1250.082032.664
3_backdoor86.486.4477.1141.71.164770.6
4_breastw0.023440.0351649.840.0039060.0039060
5_campaign12.0712.07108.319.670.5116.7
6_cardio0.0039060.0156249.90.015620.015622.512
7_Cardiotocography00.0156249.960.023440.019532.656
8_celeba37.6537.93229.760.142.789327.5
9_census689.8689.6347611424.1176163
10_cover15.7315.71111.523.143.5130.7
11_donors40.6840.44192.547.768.527283.2
12_fault0.015620.0156250.030.019530.019533.09
13_fraud42.7142.33240.262.173.922338.8
14_glass00.0156249.77000
15_Hepatitis0.01562049.770.00390600
16_http12.991383.2815.616.94975.22
17_InternetAds14.0714.07120.323.410.01953116.2
18_Ionosphere00.0156249.59000.3906
19_landsat0052.240.074220.074228.836
20_letter0.01562050.280.19920.015622.969
21_Lymphography0.015620.0156249.79000
22_magic.gamma0051.960.22660.22667.977
23_mammography0051.040.20310.13283.07
24_mnist3.5163.51667.755.8280.0859428.49
25_musk2.342.3462.053.8870.0351619.27
26_optdigits1.571.55557.952.5660.0585912.65
27_PageBlocks00.0156250.010.058590.058593.094
28_pendigits0.003906051.340.078120.078124.191
29_Pima00.0156249.760.0039060.0039060.03516
30_satellite0.015620.0156253.821.0470.0742210.23
31_satimage-20.01562052.10.066410.066417.969
32_shuttle1.4181.41458.733.5980.597720.05
33_skin6.7346.7365.596.7382.99632.23
34_smtp2.182.17655.962.6131.1612.43
35_SpamBase0.015620.0195352.290.046880.046888.961
36_speech6.7856.80184.2111.280.0390655.87
37_Stamps00.0156249.710.00390600.0625
38_thyroid0.01562049.720.039060.039061.023
39_vertebral0.015620.0156249.79000
40_vowels0049.550.011720.015620.6562
41_Waveform00.01562510.035160.035162.758
42_WBC0.01562049.7300.0039060
43_WDBC0049.64000.4492
44_Wilt0049.590.054690.058591.09
45_wine0049.79000
46_WPBC0049.73000.03906
47_yeast0049.750.011720.011720.5039

Saving and loading

datasetvariantsave, sload, sfile, MB
ECODInductiveECODpyod-ECODECODInductiveECODpyod-ECODECODInductiveECODpyod-ECOD
1000x10default0.0001525 (×3.8)0.0001453 (×4.0)0.00058340.00008596 (×4.7)0.00008291 (×4.9)0.00040480.043960.043970.2389
1000x10compressed0.002032 (×2.8)0.002037 (×2.8)0.005780.00008859 (×20.4)0.00008465 (×21.4)0.001810.043940.043950.09782
10000x10default0.0009483 (×1.8)0.0008631 (×2.0)0.0016870.0004955 (×1.6)0.0005062 (×1.6)0.00079080.43560.43562.381
10000x10compressed0.0294 (×3.0)0.02608 (×3.3)0.087090.000639 (×29.9)0.0006214 (×30.7)0.019080.42790.42721.633
100000x10default0.01509 (×0.9)0.01579 (×0.9)0.014060.005517 (×1.7)0.005366 (×1.8)0.0096244.1794.17923.8
100000x10compressed0.8443 (×1.4)0.7922 (×1.5)1.1860.008093 (×26.2)0.008129 (×26.0)0.21173.7313.73121.61
1000000x10default0.1873 (×0.7)0.1818 (×0.8)0.13790.1082 (×0.5)0.1066 (×0.5)0.0553440.6140.61238
1000000x10compressed13.06 (×0.9)12.73 (×1.0)12.280.113 (×18.5)0.1154 (×18.1)2.09130.6430.64223
10000x100default0.01504 (×0.9)0.01506 (×0.9)0.012820.005496 (×1.8)0.005449 (×1.8)0.009624.3234.32322.98
10000x100compressed0.65 (×1.3)0.6561 (×1.3)0.83320.006057 (×30.1)0.00614 (×29.7)0.18264.2814.28115.65
100000x100default0.199 (×0.7)0.1971 (×0.7)0.13750.112 (×0.5)0.1142 (×0.5)0.0562941.7141.71229.8
100000x100compressed12.04 (×1.0)11.89 (×1.0)11.650.1381 (×14.4)0.1392 (×14.3)1.98937.3137.31211.4

Quality

ROC AUC on the ADBench test part.

datasetROC AUC
ECODInductiveECODpyod-ECOD
1_ALOI0.52640.52620.5264
2_annthyroid0.7570.75420.757
3_backdoor0.84820.84860.8482
4_breastw0.99290.9920.9929
5_campaign0.76530.76520.7653
6_cardio0.92910.9270.9291
7_Cardiotocography0.78360.78530.7836
8_celeba0.74850.74860.7485
9_census0.66030.66080.6603
10_cover0.92380.92340.9238
11_donors0.88840.88790.8884
12_fault0.49750.50010.4975
13_fraud0.94640.94640.9464
14_glass0.78710.78710.7871
15_Hepatitis0.77140.78860.7714
16_http0.97870.97860.9787
17_InternetAds0.68330.6850.6833
18_Ionosphere0.73360.73540.7336
19_landsat0.38260.38530.3826
20_letter0.52060.51380.5206
21_Lymphography111
22_magic.gamma0.6350.6340.635
23_mammography0.92880.92950.9288
24_mnist0.74220.73910.7422
25_musk0.94920.94450.9492
26_optdigits0.59380.59850.5938
27_PageBlocks0.91160.90930.9116
28_pendigits0.92870.93010.9287
29_Pima0.60840.60420.6084
30_satellite0.59450.59660.5945
31_satimage-20.96360.96360.9636
32_shuttle0.99370.99380.9937
33_skin0.48850.48920.4885
34_smtp0.95360.95350.9536
35_SpamBase0.6730.67930.673
36_speech0.44810.44930.4481
37_Stamps0.87820.87760.8782
38_thyroid0.97750.97720.9775
39_vertebral0.28270.27680.2827
40_vowels0.56430.55070.5643
41_Waveform0.62880.62810.6288
42_WBC0.99230.99230.9923
43_WDBC0.95980.9510.9598
44_Wilt0.40180.39790.4018
45_wine0.430.40.43
46_WPBC0.440.42380.44
47_yeast0.43350.43270.4335