Skip to main content

FdaData

Struct FdaData 

Source
pub struct FdaData {
    pub curves: Option<FdMatrix>,
    pub argvals: Option<Vec<f64>>,
    pub grouping: Vec<GroupVar>,
    pub scalar_vars: Vec<NamedVec>,
    pub tabular: Option<FdMatrix>,
    pub column_names: Option<Vec<String>>,
    pub layers: HashMap<LayerKey, Layer>,
}
Expand description

Unified FDA data object for pipeline interchange.

Carries functional data (curves + domain) plus optional analysis layers. Nodes read what they need and add their results as new layers.

Fields§

§curves: Option<FdMatrix>

Functional observations (n × m). None for tabular-only data.

§argvals: Option<Vec<f64>>

Evaluation grid (length m).

§grouping: Vec<GroupVar>

Named grouping variables (multiple allowed).

§scalar_vars: Vec<NamedVec>

Named scalar variables (each length n).

§tabular: Option<FdMatrix>

Tabular data for non-functional variables (n × p).

§column_names: Option<Vec<String>>

Column names for tabular data.

§layers: HashMap<LayerKey, Layer>

Analysis results keyed by layer type.

Implementations§

Source§

impl FdaData

Source

pub fn from_curves(curves: FdMatrix, argvals: Vec<f64>) -> Self

Create from functional curves + grid.

Source

pub fn from_tabular(tabular: FdMatrix, column_names: Vec<String>) -> Self

Create from tabular (non-functional) data.

Source

pub fn empty() -> Self

Create empty container.

Source

pub fn require_curves(&self) -> Result<(&FdMatrix, &[f64]), String>

Require functional curves to be present.

Source

pub fn require_layer(&self, key: &LayerKey) -> Result<&Layer, String>

Require a specific layer to be present.

Source

pub fn has_layer(&self, key: &LayerKey) -> bool

Check if a layer is present.

Source

pub fn get_layer(&self, key: &LayerKey) -> Option<&Layer>

Get a layer by key.

Source

pub fn set_layer(&mut self, key: LayerKey, layer: Layer)

Set (add or replace) a layer.

Source

pub fn remove_layer(&mut self, key: &LayerKey) -> Option<Layer>

Remove a layer.

Source

pub fn layer_keys(&self) -> Vec<&LayerKey>

List all layer keys present.

Source

pub fn fpca(&self) -> Option<&FpcaLayer>

Get FPCA layer if present.

Source

pub fn distances(&self) -> Option<&DistancesLayer>

Get distances layer if present.

Source

pub fn alignment(&self) -> Option<&AlignmentLayer>

Get alignment layer if present.

Source

pub fn regression(&self) -> Option<&RegressionLayer>

Get regression layer if present.

Source

pub fn clusters(&self) -> Option<&ClusterLayer>

Get cluster layer if present.

Source

pub fn depth(&self) -> Option<&DepthLayer>

Get depth layer if present.

Source

pub fn outliers(&self) -> Option<&OutlierLayer>

Get outlier layer if present.

Source

pub fn n_obs(&self) -> usize

Number of observations (from curves, tabular, or first scalar var).

Source

pub fn n_points(&self) -> usize

Number of grid points (0 if no functional data).

Source

pub fn add_scalar(&mut self, name: impl Into<String>, values: Vec<f64>)

Add a scalar variable.

Source

pub fn get_scalar(&self, name: &str) -> Option<&[f64]>

Get a scalar variable by name.

Source

pub fn add_grouping(&mut self, name: impl Into<String>, labels: Vec<String>)

Add a grouping variable with per-observation string labels.

Unique labels are computed automatically in order of first appearance.

Source

pub fn get_grouping(&self, name: &str) -> Option<&GroupVar>

Look up a grouping variable by name.

Trait Implementations§

Source§

impl Clone for FdaData

Source§

fn clone(&self) -> FdaData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FdaData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V