pub struct ObservationalData { /* private fields */ }Expand description
Container for observational (non-interventional) data.
Data is stored as a matrix: samples[i] is the i-th observation,
with one entry per variable in the same order as variables.
Implementations§
Source§impl ObservationalData
impl ObservationalData
Sourcepub fn new(variables: Vec<String>) -> Self
pub fn new(variables: Vec<String>) -> Self
Create an empty dataset with the given variable names.
Sourcepub fn add_sample(&mut self, sample: Vec<f64>) -> Result<(), CausalError>
pub fn add_sample(&mut self, sample: Vec<f64>) -> Result<(), CausalError>
Add a single observation. Returns an error if the dimension does not match.
Sourcepub fn n_variables(&self) -> usize
pub fn n_variables(&self) -> usize
Number of variables.
Trait Implementations§
Source§impl Clone for ObservationalData
impl Clone for ObservationalData
Source§fn clone(&self) -> ObservationalData
fn clone(&self) -> ObservationalData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ObservationalData
impl RefUnwindSafe for ObservationalData
impl Send for ObservationalData
impl Sync for ObservationalData
impl Unpin for ObservationalData
impl UnsafeUnpin for ObservationalData
impl UnwindSafe for ObservationalData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more