pub struct InterventionEngine { /* private fields */ }Expand description
Engine for running causal interventions and estimating treatment effects.
Implementations§
Source§impl InterventionEngine
impl InterventionEngine
Sourcepub fn new(scm: StructuralCausalModel) -> Self
pub fn new(scm: StructuralCausalModel) -> Self
Create a new intervention engine wrapping a structural causal model.
Sourcepub fn do_intervention(
&self,
interventions: &[(String, f64)],
n_samples: usize,
seed: u64,
) -> Result<InterventionResult, SynthError>
pub fn do_intervention( &self, interventions: &[(String, f64)], n_samples: usize, seed: u64, ) -> Result<InterventionResult, SynthError>
Run a do-calculus intervention and estimate causal effects.
Generates baseline samples (no intervention) and intervened samples, then computes the average treatment effect for each variable.
Auto Trait Implementations§
impl Freeze for InterventionEngine
impl RefUnwindSafe for InterventionEngine
impl Send for InterventionEngine
impl Sync for InterventionEngine
impl Unpin for InterventionEngine
impl UnsafeUnpin for InterventionEngine
impl UnwindSafe for InterventionEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.