1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! SGBT ensemble orchestrator -- the core boosting loop.
//!
//! Implements Streaming Gradient Boosted Trees (Gunasekara et al., 2024):
//! a sequence of boosting steps, each owning a streaming tree and drift detector,
//! with automatic tree replacement when concept drift is detected.
//!
//! # Algorithm
//!
//! For each incoming sample `(x, y)`:
//! 1. Compute the current ensemble prediction: `F(x) = base + lr * Σ tree_s(x)`
//! 2. For each boosting step `s = 1..N`:
//! - Compute gradient `g = loss.gradient(y, current_pred)`
//! - Compute hessian `h = loss.hessian(y, current_pred)`
//! - Feed `(x, g, h)` to tree `s` (which internally uses weighted squared loss)
//! - Update `current_pred += lr * tree_s.predict(x)`
//! 3. The ensemble adapts incrementally, with each tree targeting the residual
//! of all preceding trees.
use Box;
use crateLoss;
// Used in doc links + tests
use crateSample;
use crateTreeConfig;
// Re-export core types from the core module
pub use SGBT;
/// Type alias for an SGBT model using dynamic (boxed) loss dispatch.
///
/// Use this when the loss function is determined at runtime (e.g., when
/// deserializing a model from JSON where the loss type is stored as a tag).
///
/// For compile-time loss dispatch (preferred for performance), use
/// `SGBT<LogisticLoss>`, `SGBT<HuberLoss>`, etc.
pub type DynSGBT = ;
// Stub for methods to be implemented.
// This file serves as the hub for the ensemble module.
// Actual implementation methods will be added across multiple files
// in a future wave (accessors, inference, inspection, train, etc.).