pub struct DeviationConfig {
pub k: f64,
pub floors: BTreeMap<String, f64>,
pub default_floor: f64,
}Expand description
The deviation test’s settings: k and the floor of each dimension (spec 3.2 §7.10).
The default sets k = 2.5, a floor of ACTIVITY_MINUTE_FLOOR for the two time-of-day
dimensions daily_series derives, and a floor of 0 for every other dimension.
§Example
use adk_eval::ledger::DeviationConfig;
let config = DeviationConfig::default().with_floor("tool_call.count", 2.0);
assert_eq!(config.floor("tool_call.count"), 2.0);
assert_eq!(config.floor("activity.last_minute"), 45.0);
assert_eq!(config.floor("approval.count"), 0.0);Fields§
§k: f64The MAD multiplier, DEVIATION_K by default.
floors: BTreeMap<String, f64>Floors by dimension name.
default_floor: f64The floor of a dimension without its own.
Implementations§
Source§impl DeviationConfig
impl DeviationConfig
Sourcepub fn with_floor(self, dimension: impl Into<String>, floor: f64) -> Self
pub fn with_floor(self, dimension: impl Into<String>, floor: f64) -> Self
Sets the floor of one dimension.
Sourcepub fn with_default_floor(self, floor: f64) -> Self
pub fn with_default_floor(self, floor: f64) -> Self
Sets the floor of every dimension without its own.
Trait Implementations§
Source§impl Clone for DeviationConfig
impl Clone for DeviationConfig
Source§impl Debug for DeviationConfig
impl Debug for DeviationConfig
Source§impl Default for DeviationConfig
impl Default for DeviationConfig
Source§impl<'de> Deserialize<'de> for DeviationConfig
impl<'de> Deserialize<'de> for DeviationConfig
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 DeviationConfig
impl PartialEq for DeviationConfig
Source§impl Serialize for DeviationConfig
impl Serialize for DeviationConfig
impl StructuralPartialEq for DeviationConfig
Auto Trait Implementations§
impl Forget for DeviationConfig
impl Freeze for DeviationConfig
impl Move for DeviationConfig
impl RefUnwindSafe for DeviationConfig
impl Send for DeviationConfig
impl Sync for DeviationConfig
impl Unpin for DeviationConfig
impl UnsafeUnpin for DeviationConfigwhere
*const LeafNode<String, f64> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, f64)>>: UnsafeUnpin,
impl UnwindSafe for DeviationConfig
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