pub trait Structural: StreamingLearner {
// Required methods
fn apply_structural_change(&mut self, depth_delta: i32, steps_delta: i32);
fn replacement_count(&self) -> u64;
// Provided methods
fn check_proactive_prune(&mut self) -> bool { ... }
fn set_prune_half_life(&mut self, _hl: usize) { ... }
fn tree_structure(&self) -> Vec<(usize, usize, f64, f64, u64)> { ... }
}alloc only.Expand description
Models whose internal capacity can grow or shrink at runtime.
Implemented by tree ensemble models: SGBT, AdaptiveRandomForest, DistributionalSGBT, BaggedSGBT, stacked ensembles that delegate to trees.
§Object Safety
This trait is object-safe. Box<dyn Structural> is a legal type.
Required Methods§
Sourcefn apply_structural_change(&mut self, depth_delta: i32, steps_delta: i32)
fn apply_structural_change(&mut self, depth_delta: i32, steps_delta: i32)
Apply depth/step changes that take effect at the next tree replacement.
depth_delta– signed adjustment to maximum tree depth (+1, -1, 0).steps_delta– signed adjustment to ensemble step count (+2, -2, 0).
Sourcefn replacement_count(&self) -> u64
fn replacement_count(&self) -> u64
Total number of internal model replacements since creation or last reset.
External callers use this counter to detect replacement boundaries and apply queued structural changes.
Provided Methods§
Sourcefn check_proactive_prune(&mut self) -> bool
fn check_proactive_prune(&mut self) -> bool
Manually trigger a proactive prune check.
Returns true if an internal component was pruned or replaced.
Defaults to false (no-op) for models without proactive pruning.
Sourcefn set_prune_half_life(&mut self, _hl: usize)
fn set_prune_half_life(&mut self, _hl: usize)
Dynamically set the contribution-accuracy EWMA half-life.
Recomputes prune_alpha so each correction batch contributes equally
regardless of batch size. Default: no-op for models without an EWMA
prune accumulator.