lazymatrix::RowNormalization
LazyMatrix for Rust · 0.9.0
pub struct RowNormalizationA row normalization specification with independent Centering and Scaling choices.
The default performs no centering or scaling. Norms (L1, L2, and MaxAbs) are fitted to centered rows when centering is active. Standard deviations, ranges, and quantile ranges are translation-invariant. Use crate::RowNormalizedMatrix::new to fit each row independently.
Fields
center
pub center: CenteringHow to center each row.
scale
pub scale: ScalingHow to scale each row.
Inherent implementation
impl RowNormalizationmin_max
pub const fn min_max() -> SelfSubtract each row's minimum and divide by its range.
Finite, nonconstant rows span [0, 1] on the fitting data. Fitting replaces exact zero ranges with one, so finite constant rows become zero. Reusing parameters does not clip values to [0, 1].
new
pub const fn new(center: Centering, scale: Scaling) -> SelfBuild a specification from its centering and scaling choices.
robust
pub fn robust() -> SelfSubtract each row's median and divide by its interquartile range.
Quantiles use linear interpolation at (ncols - 1) * q. There is no standard-normal calibration. Fitting replaces exact zero ranges with one. Use Self::new with Scaling::QuantileRange for custom bounds.
standardize
pub const fn standardize() -> SelfSubtract each row's mean and divide by its population standard deviation.
The variance uses ncols as its divisor. Fitting replaces exact zero scales with one, so finite constant rows become zero. For sample standard deviations, use Self::new(Centering::Mean, Scaling::Sd { df: 1 }).
Implementation of Clone
impl Clone for RowNormalizationclone
fn clone(&self) -> SelfImplementation of Copy
impl Copy for RowNormalizationImplementation of Debug
impl Debug for RowNormalizationfmt
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::ResultImplementation of Default
impl Default for RowNormalizationdefault
fn default() -> SelfImplementation of Eq
impl Eq for RowNormalizationImplementation of PartialEq
impl PartialEq for RowNormalizationeq
fn eq(&self, other: &Self) -> boolImplementation of StructuralPartialEq
impl StructuralPartialEq for RowNormalizationImplementation of Freeze
impl Freeze for RowNormalizationImplementation of RefUnwindSafe
impl RefUnwindSafe for RowNormalizationImplementation of Send
impl Send for RowNormalizationImplementation of Sync
impl Sync for RowNormalizationImplementation of Unpin
impl Unpin for RowNormalizationImplementation of UnsafeUnpin
impl UnsafeUnpin for RowNormalizationImplementation of UnwindSafe
impl UnwindSafe for RowNormalizationImplementation of Any
impl<T> Any for T where T: 'static + ?SizedImplementation of Boilerplate
impl<T> Boilerplate for T where T: Copy + Send + Sync + Debug + PartialEq + 'staticImplementation of Borrow
impl<T> Borrow<T> for T where T: ?SizedImplementation of BorrowMut
impl<T> BorrowMut<T> for T where T: ?SizedImplementation of ByRef
impl<T> ByRef<T> for TImplementation of CastableFrom
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?SizedImplementation of CastableFrom
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?SizedImplementation of CloneToUninit
impl<T> CloneToUninit for T where T: CloneImplementation of Equivalent
impl<Q, K> Equivalent<K> for Q where Q: Eq + ?Sized, K: Borrow<Q> + ?SizedImplementation of Equivalent
impl<Q, K> Equivalent<K> for Q where Q: Eq + ?Sized, K: Borrow<Q> + ?SizedImplementation of From
impl<T> From<T> for TImplementation of Imply
impl<T, U> Imply<T> for U where T: ?Sized, U: ?SizedImplementation of Into
impl<T, U> Into<U> for T where U: From<T>Implementation of IntoEither
impl<T> IntoEither for TImplementation of Pointable
impl<T> Pointable for TImplementation of Read
impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?SizedImplementation of Same
impl<T> Same for TImplementation of Scalar
impl<T> Scalar for T where T: 'static + Clone + PartialEq + DebugImplementation of SupersetOf
impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>Implementation of ToOwned
impl<T> ToOwned for T where T: CloneImplementation of TryFrom
impl<T, U> TryFrom<U> for T where U: Into<T>Implementation of TryInto
impl<T, U> TryInto<U> for T where U: TryFrom<T>
