pub struct Normalizer {
pub kind: NormKind,
}Expand description
Per-row rescaling to unit norm.
Transform: for each row, x ← x / ‖x‖_p where p is one of
NormKind::L1, NormKind::L2, NormKind::Max. Zero rows are
left unchanged (matches preprocessing.Normalizer).
Unlike the column-wise scalers, Normalizer does not need a fit —
the per-row norm is computed at transform time. It’s exposed as a
struct anyway to fit into the common preprocessing API.
Fields§
§kind: NormKindThe norm to rescale by.
Implementations§
Source§impl Normalizer
impl Normalizer
Sourcepub fn fit_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
pub fn fit_transform(&self, x: ArrayView2<'_, f64>) -> Result<Array2<f64>>
Row-wise fit-transform is identical to transform (no state).
Trait Implementations§
Source§impl Clone for Normalizer
impl Clone for Normalizer
impl Copy for Normalizer
Source§impl Debug for Normalizer
impl Debug for Normalizer
Source§impl<'de> Deserialize<'de> for Normalizer
impl<'de> Deserialize<'de> for Normalizer
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 PartialEq for Normalizer
impl PartialEq for Normalizer
Source§impl Serialize for Normalizer
impl Serialize for Normalizer
impl StructuralPartialEq for Normalizer
Auto Trait Implementations§
impl Freeze for Normalizer
impl RefUnwindSafe for Normalizer
impl Send for Normalizer
impl Sync for Normalizer
impl Unpin for Normalizer
impl UnsafeUnpin for Normalizer
impl UnwindSafe for Normalizer
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