pub struct ExperimentalDataset {
pub metadata: SensorMetadata,
pub samples: Vec<DataSample>,
}Expand description
Experimental time series dataset.
Fields§
§metadata: SensorMetadataSensor metadata.
samples: Vec<DataSample>Ordered samples.
Implementations§
Source§impl ExperimentalDataset
impl ExperimentalDataset
Sourcepub fn new(metadata: SensorMetadata) -> Self
pub fn new(metadata: SensorMetadata) -> Self
Create an empty dataset with the given metadata.
Sourcepub fn flag_outliers_iqr(&mut self, k: f64)
pub fn flag_outliers_iqr(&mut self, k: f64)
Flag outliers using the IQR method (fence factor k, typically 1.5).
Sourcepub fn flag_outliers_zscore(&mut self, z_thresh: f64)
pub fn flag_outliers_zscore(&mut self, z_thresh: f64)
Flag outliers using the z-score method (threshold z_thresh, typically 3.0).
Sourcepub fn outliers(&self) -> Vec<&DataSample>
pub fn outliers(&self) -> Vec<&DataSample>
Return only the outlier samples.
Sourcepub fn from_csv(csv: &str, metadata: SensorMetadata) -> Result<Self, String>
pub fn from_csv(csv: &str, metadata: SensorMetadata) -> Result<Self, String>
Parse from CSV text: time,value rows.
Sourcepub fn range(&self) -> Option<(f64, f64)>
pub fn range(&self) -> Option<(f64, f64)>
Return min and max of non-outlier values, or None if empty.
Sourcepub fn downsample(&self, n: usize) -> Self
pub fn downsample(&self, n: usize) -> Self
Downsample by keeping every n-th sample.
Trait Implementations§
Source§impl Clone for ExperimentalDataset
impl Clone for ExperimentalDataset
Source§fn clone(&self) -> ExperimentalDataset
fn clone(&self) -> ExperimentalDataset
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 ExperimentalDataset
impl RefUnwindSafe for ExperimentalDataset
impl Send for ExperimentalDataset
impl Sync for ExperimentalDataset
impl Unpin for ExperimentalDataset
impl UnsafeUnpin for ExperimentalDataset
impl UnwindSafe for ExperimentalDataset
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<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.