Speed comparison¶
Question¶
How fast is robustcov compared with common sklearn covariance baselines?
Design¶
This benchmark uses a representative classical contamination setting and compares robustcov FastMCD,
Tyler-family estimators, sklearn empirical covariance, and sklearn MinCovDet. Empirical covariance
is included as a non-robust lower-bound reference; the most meaningful robust comparison is
robustcov FastMCD versus sklearn MinCovDet.
Timing table¶
method |
median_seconds |
min_seconds |
max_seconds |
|---|---|---|---|
robustcov FastMCD |
0.023761 |
0.023498 |
0.024421 |
robustcov TylerShape |
0.001889 |
0.001869 |
0.002081 |
robustcov RegTyler |
0.001691 |
0.001674 |
0.001742 |
sklearn EmpiricalCovariance |
0.000202 |
0.000172 |
0.000817 |
sklearn MinCovDet |
0.191902 |
0.190605 |
0.193694 |
Plot¶
Interpretation¶
FastMCD is the package’s classical robust-covariance workhorse. The speed benchmark shows why it is worth keeping even though the newer heavy-tail estimators are the main small-sample differentiator. When users have separable contamination and \(n \gg p\), FastMCD is easy to explain, fast, and compatible with robust-distance anomaly diagnostics.
Run it yourself¶
python benchmarks/speed_estimators.py --n 2000 --p 10 --repeat 5 --quality fast --csv results/speed.csv
python examples/plot_speed_comparison.py --input results/speed.csv --output results/speed.png