alloc only.Expand description
Unified streaming learner trait for polymorphic model composition.
StreamingLearner is an object-safe trait that abstracts over any
online/streaming machine learning model – gradient boosted trees, linear
models, Naive Bayes, Mondrian forests, or anything else that can ingest
samples one at a time and produce predictions.
§Motivation
Stacking ensembles and meta-learners need to treat heterogeneous base
models uniformly: train them on the same stream, collect their predictions
as features for a combiner, and manage their lifecycle (reset, clone,
serialization). StreamingLearner provides exactly this interface.
§Object Safety
The trait is deliberately object-safe: every method uses &self /
&mut self with concrete return types (no generics on methods, no
Self-by-value in non-Sized positions). This means you can store
Box<dyn StreamingLearner> in a Vec, enabling runtime-polymorphic
stacking without monomorphization.
§Capability Traits
Opt-in capability traits narrow the required bound to the actual capability a wrapper or algorithm needs, enabling cleaner type-level documentation:
HasReadout– models with a linear RLS readout layer (neural models, KRLS, RLS). Used byProjectedLearnersupervised-projection path.Tunable– models that expose diagnostics and accept LR / lambda adjustments from AutoML components.Structural– models whose capacity can grow or shrink at runtime (tree ensembles: SGBT, ARF, Mondrian).
Traits§
- HasReadout
- Models that expose a linear readout weight vector.
- Streaming
Learner - Object-safe trait for any streaming (online) machine learning model.
- Structural
- Models whose internal capacity can grow or shrink at runtime.
- Tunable
- Models that expose diagnostics and accept smooth hyperparameter adjustments.