isolation_forest_prototype#1
Open
prachin-tuladhar wants to merge 5 commits into
Open
Conversation
feat(classical): implement ClassicalDetector with per-class dynamic threshold
- Stub model class wrapping sklearn IsolationForest (fit/score/predict)
- Flip sklearn's raw convention to {0,1} labels, higher score = more anomalous
- Add fit_dynamic_threshold()/predict_dynamic() for per-process-class
thresholding, following Shamim et al. (2023) rather than a global cutoff
- Smoke-tested on grouped toy data (quiet vs noisy classes): 0 false
positives, 6/6 injected attacks caught
Ref: Task Tracker Week 2 & 3 (Prachin)
Note: label/threshold convention is my own design choice pending
test(classical): add unit test suite for ClassicalDetector - 14 tests covering fit/score/predict, dynamic threshold, error handling, and reproducibility - All passing against Week 3 baseline - Documents score range behavior (not a fixed interval, see SCORE_RANGE_NOTES) Ref: Task Tracker Week 4 (Prachin) note for me python -m pytest test_classical_detector.py -v cd C:\Users\Asus\Desktop pip install pytest
feat(classical): add evaluation harness stand-in, tune dynamic threshold k - evaluate(): FPR/Recall/F1/AUROC, no accuracy (Layman & Roden, Hesford et al.) - tune_threshold(): sweeps k across ClassicalDetector's dynamic threshold - Best F1 on toy data at k=3.0: FPR=0.000, Recall=0.933, F1=0.966, AUROC=0.998 - Stand-in until Vignesh's shared harness lands; same interface, drop-in swap Ref: Task Tracker Week 5 (Prachin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(classical): validate IsolationForest + sklearn setup on toy data
Ref: Task Tracker Week 1 (Prachin)