pub struct MaskedSample { /* private fields */ }Expand description
A data sample with potentially missing values.
Implementations§
Source§impl MaskedSample
impl MaskedSample
Sourcepub fn mask_non_finite(data: DVector<f64>) -> MaskedSample
pub fn mask_non_finite(data: DVector<f64>) -> MaskedSample
Creates a masked sample from a vector, masking all elements which are not finite (e.g.,
NaN and inf).
Sourcepub fn new(data: DVector<f64>, mask: Mask) -> MaskedSample
pub fn new(data: DVector<f64>, mask: Mask) -> MaskedSample
Creates a masked sample from data and a mask. The value is considered missing if its index
in the masked is set to false.
Sourcepub fn unmasked(data: DVector<f64>) -> MaskedSample
pub fn unmasked(data: DVector<f64>) -> MaskedSample
Creates a sample without any masked values.
Sourcepub fn data_vector(&self) -> DVector<f64>
pub fn data_vector(&self) -> DVector<f64>
Returns the data vector associated with this sample.
Sourcepub fn mask(&self) -> &Mask
pub fn mask(&self) -> &Mask
Returns the mask of this sample. The value is considered missing if its index
in the masked is set to false.
Sourcepub fn is_set(&self, idx: usize) -> bool
pub fn is_set(&self, idx: usize) -> bool
Returns whether the idx dimension in this sample is set.
§Panics
This function panics if idx is out of bounds.
Sourcepub fn masked_vector(&self) -> DVector<f64>
pub fn masked_vector(&self) -> DVector<f64>
Returns the data vector associated with this sample, substituting all masked values by NaN.
Trait Implementations§
Source§impl Clone for MaskedSample
impl Clone for MaskedSample
Source§fn clone(&self) -> MaskedSample
fn clone(&self) -> MaskedSample
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 moreSource§impl Debug for MaskedSample
impl Debug for MaskedSample
Source§impl<'de> Deserialize<'de> for MaskedSample
impl<'de> Deserialize<'de> for MaskedSample
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 FromIterator<MaskedSample> for Dataset
impl FromIterator<MaskedSample> for Dataset
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = MaskedSample>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = MaskedSample>,
Creates a value from an iterator. Read more
Source§impl FromParallelIterator<MaskedSample> for Dataset
impl FromParallelIterator<MaskedSample> for Dataset
Source§fn from_par_iter<T>(iter: T) -> Selfwhere
T: IntoParallelIterator<Item = MaskedSample>,
fn from_par_iter<T>(iter: T) -> Selfwhere
T: IntoParallelIterator<Item = MaskedSample>,
Creates an instance of the collection from the parallel iterator
par_iter. Read moreSource§impl Index<usize> for MaskedSample
impl Index<usize> for MaskedSample
Auto Trait Implementations§
impl Freeze for MaskedSample
impl RefUnwindSafe for MaskedSample
impl Send for MaskedSample
impl Sync for MaskedSample
impl Unpin for MaskedSample
impl UnwindSafe for MaskedSample
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.