pub struct Normalize { /* private fields */ }Expand description
A transform that normalizes numeric columns.
Supports min-max scaling, z-score standardization, and L2 normalization.
§Example
ⓘ
use alimentar::{Normalize, NormMethod};
// Min-max normalize specific columns
let normalize = Normalize::new(vec!["feature1", "feature2"], NormMethod::MinMax);
// Z-score normalize all numeric columns
let normalize = Normalize::all_numeric(NormMethod::ZScore);Implementations§
Source§impl Normalize
impl Normalize
Sourcepub fn new<S: Into<String>>(
columns: impl IntoIterator<Item = S>,
method: NormMethod,
) -> Self
pub fn new<S: Into<String>>( columns: impl IntoIterator<Item = S>, method: NormMethod, ) -> Self
Creates a Normalize transform for specific columns.
Sourcepub fn all_numeric(method: NormMethod) -> Self
pub fn all_numeric(method: NormMethod) -> Self
Creates a Normalize transform that applies to all numeric columns.
Sourcepub fn columns(&self) -> Option<&[String]>
pub fn columns(&self) -> Option<&[String]>
Returns the columns to normalize (None means all numeric).
Sourcepub fn method(&self) -> NormMethod
pub fn method(&self) -> NormMethod
Returns the normalization method.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Normalize
impl RefUnwindSafe for Normalize
impl Send for Normalize
impl Sync for Normalize
impl Unpin for Normalize
impl UnsafeUnpin for Normalize
impl UnwindSafe for Normalize
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreCreates a shared type from an unshared type.