Cybersecurity-Projects/PROJECTS
CarterPerez-dev 989635e7b0 feat: add Aenebris.ML.IForest for anomaly scoring
- New Aenebris.ML.IForest module: pure Isolation Forest scorer
  implementing the Liu et al. 2008 ICDM formula
  anomaly_score = 2^(-E[h(x)] / c(n))
  where E[h(x)] is the average path length across iTrees and
  c(n) = 2*H(n-1) - 2(n-1)/n  (expected unsuccessful BST search depth).
  ITree ADT (ITreeLeaf size | ITreeSplit featIdx threshold left right)
  with leaf-size c(n) correction added to traversal depth at every
  leaf, matching the original paper. Score-only mode (accept pre-
  trained forests from Python sklearn or similar); fitting is deferred
  to a later phase. Default constants from Liu et al.: 100 trees,
  256 subsample size, max depth ceil(log2(256)) = 8.

- 24 tests covering: harmonicNumber edge cases (H(0), H(1), H(2),
  H(3), large-n asymptotic), normalizationConstant for n in {0, 1,
  2, 256}, single-split and deep-tree path length traversal,
  scoreIForest edge cases (empty forest, subsample 0, subsample 1),
  shorter-path-equals-higher-score invariant, default constants,
  Euler-Mascheroni precision.

- aenebris.cabal: expose Aenebris.ML.IForest in the library stanza.
- test/Spec.hs: import Expectation explicitly from Test.Hspec for the
  shouldBeApprox helper.

- 325 total examples passing, 0 GHC warnings on the new module.

The escalation-gate composition with the calibrated GBDT score
(per docs/research/phase-2.5-ml-synthesis.md correction over the
0.8/0.2 folk-wisdom blend) is intentionally NOT in this module --
it belongs in the downstream ML.Engine module that wires Loader +
Inference + Calibration + IForest into a single decision pipeline.
2026-04-29 00:42:18 -04:00
..
advanced feat: add Aenebris.ML.IForest for anomaly scoring 2026-04-29 00:42:18 -04:00
beginner Merge remote-tracking branch 'origin/main' into chore/haskell-reverse-proxy-finish 2026-04-28 17:57:03 -04:00
intermediate Merge remote-tracking branch 'origin/main' into chore/haskell-reverse-proxy-finish 2026-04-28 17:57:03 -04:00