SPB Git

spb/metrika Public

Stata-class statistics, GPU-accelerated by Apple Silicon. Native Swift — no Electron, no Python runtime, no compromises.

Swift 92.4% HTML 3.3% R 3% Shell 1.3%

History of MetrikaKit/Tests/MetrikaKitTests/BoostTests.swift · clear filter

  1. feat(stats): gradient-boosted regression trees (boost command)
    - ZQGradientBoosting: exact-greedy trees cloning xgboost's algorithm —
      gain 1/2[GL2/(HL+l) + GR2/(HR+l) - G2/(H+l)] - gamma, leaf -G/(H+l),
      midpoint splits between consecutive distinct values, missing rows
      default left, pre-sorted feature indices; squared loss, deterministic
      (no subsampling)
    - engine: 'boost y x…, rounds(#) [eta() maxdepth() lambda()]' reporting
      training R2/RMSE with an in-sample caveat; model stored in the
      estimation state (Kind.boost) so predict routes through the trees
      (missing features follow the default direction); margins and GLM
      statistics refused after boost
    - validation: per-observation prediction parity with R xgboost 3.2
      (exact method, base_score = mean) at 1e-4 (xgboost is float32
      internally); a stump finds the exact midpoint split with lambda 0;
      training loss decreases monotonically in rounds
    - manual entry + coverage test
    - 115 tests green (swift test and xcodebuild with GPU suites)
    
    Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
    simon-pierre boucher committed 6 days ago (Aug 5, 2026) · 1 file changed +113