pub struct AggregationPolicy {
pub reducer: AggregationReducerName,
pub trim_fraction: Option<f64>,
pub threshold: Option<f64>,
pub weight_column: Option<String>,
pub custom_reducer_id: Option<String>,
}Expand description
Aggregation policy: which reducer collapses repeated predictions to one value
per sample, plus the single parameter that reducer accepts. Parameters that
do not belong to the chosen reducer must be absent (enforced by
validate). None numeric parameters take the ADR-07
defaults (DEFAULT_TRIM_FRACTION, DEFAULT_THRESHOLD).
Fields§
§reducer: AggregationReducerName§trim_fraction: Option<f64>robust_mean trim fraction in [0.0, 0.5).
threshold: Option<f64>exclude_outliers confidence threshold in (0.0, 1.0).
weight_column: Option<String>weighted_mean provider-supplied per-row weight column.
custom_reducer_id: Option<String>custom host-controller reducer id.
Implementations§
Source§impl AggregationPolicy
impl AggregationPolicy
Sourcepub fn validate(&self) -> Result<(), DataError>
pub fn validate(&self) -> Result<(), DataError>
Validate the reducer and its parameters: the reducer’s own parameter is
range-checked, and any parameter belonging to a different reducer must be
absent. No task context (see validate_for_task).
Sourcepub fn validate_for_task(
&self,
task: PredictionTaskKind,
) -> Result<(), DataError>
pub fn validate_for_task( &self, task: PredictionTaskKind, ) -> Result<(), DataError>
Validate parameters and refuse task-incompatible reducers (vote on a
regression task), raising DataError::IncompatibleReducer.
Trait Implementations§
Source§impl Clone for AggregationPolicy
impl Clone for AggregationPolicy
Source§fn clone(&self) -> AggregationPolicy
fn clone(&self) -> AggregationPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AggregationPolicy
impl Debug for AggregationPolicy
Source§impl<'de> Deserialize<'de> for AggregationPolicy
impl<'de> Deserialize<'de> for AggregationPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggregationPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AggregationPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AggregationPolicy
impl PartialEq for AggregationPolicy
Source§fn eq(&self, other: &AggregationPolicy) -> bool
fn eq(&self, other: &AggregationPolicy) -> bool
self and other values to be equal, and is used by ==.