#[non_exhaustive]pub struct BayesianConfig {
pub prior: BetaPrior,
pub decision_probability: f64,
pub max_expected_loss: Option<f64>,
pub credible_level: f64,
}Expand description
Settings of the Bayesian analysis of the primary metric (spec 3.5 §13 Q8).
§Example
use adk_eval::experiments::BayesianConfig;
let config = BayesianConfig::default().with_max_expected_loss(0.001);
assert_eq!(config.decision_probability, 0.95);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.prior: BetaPriorThe prior of each arm’s rate for proportion metrics. Mean metrics use a flat prior.
decision_probability: f64The posterior probability that one arm is better needed to decide (default 0.95).
max_expected_loss: Option<f64>When set, a decision also needs the expected loss of the chosen arm, in the metric’s units, to be at most this value.
credible_level: f64The level of the reported credible intervals (default 0.95).
Implementations§
Source§impl BayesianConfig
impl BayesianConfig
Sourcepub fn with_prior(self, prior: BetaPrior) -> Self
pub fn with_prior(self, prior: BetaPrior) -> Self
Sets the prior of each arm’s rate for proportion metrics.
Sourcepub fn with_decision_probability(self, probability: f64) -> Self
pub fn with_decision_probability(self, probability: f64) -> Self
Sets the posterior probability needed to decide.
Sourcepub fn with_max_expected_loss(self, loss: f64) -> Self
pub fn with_max_expected_loss(self, loss: f64) -> Self
Requires the chosen arm’s expected loss to be at most loss before deciding.
Sourcepub fn with_credible_level(self, level: f64) -> Self
pub fn with_credible_level(self, level: f64) -> Self
Sets the level of the reported credible intervals.
Trait Implementations§
Source§impl Clone for BayesianConfig
impl Clone for BayesianConfig
impl Copy for BayesianConfig
Source§impl Debug for BayesianConfig
impl Debug for BayesianConfig
Source§impl Default for BayesianConfig
impl Default for BayesianConfig
Source§impl<'de> Deserialize<'de> for BayesianConfig
impl<'de> Deserialize<'de> for BayesianConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BayesianConfig
impl PartialEq for BayesianConfig
Source§impl Serialize for BayesianConfig
impl Serialize for BayesianConfig
impl StructuralPartialEq for BayesianConfig
Auto Trait Implementations§
impl Forget for BayesianConfig
impl Freeze for BayesianConfig
impl Move for BayesianConfig
impl RefUnwindSafe for BayesianConfig
impl Send for BayesianConfig
impl Sync for BayesianConfig
impl Unpin for BayesianConfig
impl UnsafeUnpin for BayesianConfig
impl UnwindSafe for BayesianConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more