feat(bot-detector): implement 8 state-of-art improvements

- EIF: Extended Isolation Forest via isotree (fallback to sklearn IF)
- Benford's Law deviation feature on inter-request timing
- Lag-1 autocorrelation feature for cadence analysis
- Validation gate: reject model if val_anomaly_rate > 20%
- Feature pruning: remove variance < 1e-6 features before training
- Quantile drift: replace N(μ,σ) synthetic with quantile interpolation
- Thread safety: Lock for _service_healthy/_consecutive_failures
- Score normalization: inverted to [0,1] where 1=most anomalous

SQL: add lag1_autocorrelation + benford_deviation to view_thesis_features_1h
Tests: 10 new test functions covering all improvements
Integration: verify_mvs.py checks new thesis feature columns

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
toto
2026-04-08 02:31:26 +02:00
parent 0d1a6a81e0
commit f6e2d3c0ca
5 changed files with 318 additions and 33 deletions

View File

@ -4,5 +4,6 @@ scikit-learn==1.6.1
shap==0.47.2
scipy>=1.14
hdbscan>=0.8.38
isotree>=0.6.1
pyyaml>=6.0
ja4-common @ file:///app/shared/ja4_common