pub struct UnitChangeQuery {
pub outcome: VariableId,
pub unit_rows: Option<Arc<[usize]>>,
pub components: AttributionComponents,
pub allocation: AllocationMethod,
pub max_units: usize,
}Expand description
Per-unit change attribution query.
Fields§
§outcome: VariableIdOutcome variable.
unit_rows: Option<Arc<[usize]>>Optional factual row indices (None = all units up to max_units).
components: AttributionComponentsComponents to attribute (inputs / mechanisms / both).
allocation: AllocationMethodAllocation method.
max_units: usizeHard unit count limit.
Implementations§
Source§impl UnitChangeQuery
impl UnitChangeQuery
Sourcepub fn new(outcome: VariableId, max_units: usize) -> Self
pub fn new(outcome: VariableId, max_units: usize) -> Self
Attribute change for outcome across units.
Sourcepub fn with_unit_rows(self, rows: impl Into<Arc<[usize]>>) -> Self
pub fn with_unit_rows(self, rows: impl Into<Arc<[usize]>>) -> Self
Restrict to explicit rows.
Sourcepub const fn with_components(self, components: AttributionComponents) -> Self
pub const fn with_components(self, components: AttributionComponents) -> Self
Set components.
Sourcepub fn with_allocation(self, allocation: AllocationMethod) -> Self
pub fn with_allocation(self, allocation: AllocationMethod) -> Self
Set allocation.
Trait Implementations§
Source§impl Clone for UnitChangeQuery
impl Clone for UnitChangeQuery
Source§fn clone(&self) -> UnitChangeQuery
fn clone(&self) -> UnitChangeQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnitChangeQuery
impl Debug for UnitChangeQuery
impl Eq for UnitChangeQuery
Source§impl From<UnitChangeQuery> for CausalQuery
impl From<UnitChangeQuery> for CausalQuery
Source§fn from(query: UnitChangeQuery) -> Self
fn from(query: UnitChangeQuery) -> Self
Converts to this type from the input type.
Source§impl Hash for UnitChangeQuery
impl Hash for UnitChangeQuery
Source§impl PartialEq for UnitChangeQuery
impl PartialEq for UnitChangeQuery
impl StructuralPartialEq for UnitChangeQuery
Auto Trait Implementations§
impl Freeze for UnitChangeQuery
impl RefUnwindSafe for UnitChangeQuery
impl Send for UnitChangeQuery
impl Sync for UnitChangeQuery
impl Unpin for UnitChangeQuery
impl UnsafeUnpin for UnitChangeQuery
impl UnwindSafe for UnitChangeQuery
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