Cybersecurity-Projects/PROJECTS/advanced/haskell-reverse-proxy/test
CarterPerez-dev e5c2f59675 feat: add Aenebris.ML.Inference and Aenebris.ML.Calibration
- New Aenebris.ML.Inference module: pure tree-walk over the unified Tree
  SoA produced by Aenebris.ML.Loader. Mirrors LightGBM C++ NumericalDecision
  exactly: NaN remapped to 0 unless MissingType=NaN; MissingType=Zero/NaN
  routes via default-left flag; '<=' predicate (not '<'); categorical
  bitmap test using cat_boundaries slice; average_output divisor for RF
  mode; sigmoid link for binary logistic objective. kZeroThreshold = 1e-35
  matches LightGBM's IsZero exactly. Defensive against NaN/Inf/negative
  on categorical paths. 35 tests covering leaf-only, numerical splits,
  missing-value semantics, categorical routing, multi-tree sums, sigmoid
  saturation, average_output, regression vs binary objectives, and
  end-to-end against the disk fixture.

- New Aenebris.ML.Calibration module: pure calibration of binary
  classifier outputs. Calibrator ADT (NoCalibrator | PlattCalibrator a b
  | IsotonicCalibrator bp). Platt scaling uses Newton's method with
  damped line search on Platt-1999 smoothed targets (N+ + 1)/(N+ + 2)
  and 1/(N- + 2); numerically stable softplus-based log-loss. Isotonic
  regression uses Pool Adjacent Violators on a stack with tie pre-
  grouping, sorted (raw, calibrated) breakpoints, linear interpolation,
  out-of-range clamping. Sub-2-sample input returns NoCalibrator. 28
  tests covering all three calibrator constructors, fit edge cases,
  Platt convergence on logistic data, isotonic correction of non-
  monotone data, tie handling, all-same-label degenerate cases, and
  lookup behavior including clamping and interpolation.

- aenebris.cabal: expose both new modules in the library stanza.

- 301 total examples passing, 0 GHC warnings on either new module.
2026-04-29 00:35:07 -04:00
..
fixtures feat: add Aenebris.ML.Loader for LightGBM v4 model parsing 2026-04-28 17:35:33 -04:00
Spec.hs feat: add Aenebris.ML.Inference and Aenebris.ML.Calibration 2026-04-29 00:35:07 -04:00