pub struct BanditConfig {
pub min_observations: usize,
pub exploration: f64,
pub algorithm: BanditAlgorithm,
pub discount: f64,
}Expand description
Config for the UCB1 start-rung bandit (firstpass_proxy::bandit::StartRungBandit).
Absent (None) → start every request at rung 0 (byte-identical to today).
Fields§
§min_observations: usizeMinimum total gate-verdict observations in a context bucket before the bandit’s prediction kicks in. Below this, every request starts at rung 0 (cold-start safety).
exploration: f64UCB1 exploration constant c (Auer et al. 2002). Higher values explore more; 1.0 is the
theoretical default. Must be finite and >= 0; validated by Config::parse.
algorithm: BanditAlgorithmSelection algorithm. "ucb1" (default) is deterministic and auditable; "thompson"
samples Beta posteriors — stochastic by nature, so every decision logs a non-degenerate
propensity (clean IPS/SNIPS/DR off-policy estimates without the epsilon overlay) and
pairs with discount for non-stationary traffic.
discount: f64Per-observation multiplicative decay of a context’s counts, in (0, 1]. 1.0
(default) = no forgetting. 0.99 adapts to model churn / workload drift at the cost
of a slightly noisier estimate. Validated by Config::parse.
Trait Implementations§
Source§impl Clone for BanditConfig
impl Clone for BanditConfig
Source§fn clone(&self) -> BanditConfig
fn clone(&self) -> BanditConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more