Struct ppca::MaskedSample
source · 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, subsitituting 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 copy 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 RefUnwindSafe for MaskedSample
impl Send for MaskedSample
impl Sync for MaskedSample
impl Unpin for MaskedSample
impl UnwindSafe for MaskedSample
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.