pub struct FeatureVector { /* private fields */ }Expand description
A named feature snapshot at a single point in time.
Constructed via FeatureVectorBuilder then finalized into FeatureVector.
Implementations§
Source§impl FeatureVector
impl FeatureVector
Sourcepub fn raw_values(&self) -> &[f64]
pub fn raw_values(&self) -> &[f64]
Returns raw (un-normalized) values in insertion order.
Sourcepub fn normalization(&self) -> Normalization
pub fn normalization(&self) -> Normalization
Returns the normalization mode.
Sourcepub fn get_by_name(&self, name: &str) -> Option<f64>
pub fn get_by_name(&self, name: &str) -> Option<f64>
Returns the raw value for a feature by name, or None if not found.
Sourcepub fn to_normalized_vec(&self) -> Vec<f64>
pub fn to_normalized_vec(&self) -> Vec<f64>
Normalizes raw values according to the configured Normalization mode
and returns them as a Vec<f64>.
Normalization::None: returns raw values unchanged.Normalization::ZScore: subtracts mean and divides by std dev. Zero-variance features →0.0.Normalization::MinMax: scales to[0, 1]. Constant features →0.0.
Trait Implementations§
Source§impl Clone for FeatureVector
impl Clone for FeatureVector
Source§impl Debug for FeatureVector
impl Debug for FeatureVector
Source§impl<const N: usize> From<&[f64; N]> for FeatureVector
Implements construction from a fixed-size array reference.
impl<const N: usize> From<&[f64; N]> for FeatureVector
Implements construction from a fixed-size array reference.
Creates a FeatureVector with auto-generated names "f0", "f1", … and
Normalization::None.
Auto Trait Implementations§
impl Freeze for FeatureVector
impl RefUnwindSafe for FeatureVector
impl Send for FeatureVector
impl Sync for FeatureVector
impl Unpin for FeatureVector
impl UnsafeUnpin for FeatureVector
impl UnwindSafe for FeatureVector
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