pub enum NormalizationTransform<T: Value> {
Domain {
min: T,
max: T,
},
Clip {
min: T,
max: T,
},
MeanSubtraction,
ZScore,
LogOffset {
asymptote_epsilon: Option<T>,
},
}transforms only.Expand description
Transformations around normalization or otherwise controlling range
Variants§
Domain
Normalizes the dataset to a specified range.
Each element is linearly scaled to fit within [min, max]. Useful for
mapping values to a standard range before further processing or ML workflows.

Technical Details
xₙ = (x - x_min) / (x_max - x_min) * (max - min) + min
where
x_min and x_max are the minimum and maximum of the original dataset.§Parameters
min: Minimum value of the target range.max: Maximum value of the target range.
Clip
Restricts all values in the dataset to a specified range.
Any element smaller than min is set to min, and any element larger than
max is set to max. Useful for bounding outliers or enforcing hard limits.

Technical Details
Element-wise operation:
xₙ = min(max(x, min), max)
where
min and max are the specified bounds.§Parameters
min: Lower bound of the allowed range.max: Upper bound of the allowed range.
MeanSubtraction
Centers the dataset by subtracting its mean from every element.
After this transformation, the dataset has a mean of zero, but its variance and overall shape remain unchanged. Useful as a preprocessing step in statistics and machine learning.

Technical Details
xₙ = x - mean(x)ZScore
Normalizes the dataset to zero mean and unit variance.
Each element is centered by subtracting the dataset mean, then scaled by dividing with the standard deviation. This is a common preprocessing step in statistics and machine learning to make features comparable.

Technical Details
Element-wise operation:
xₙ = (x - mean(x)) / std(x)
where
mean(x) is the average of the dataset
std(x) is the standard deviation of the datasetLogOffset
Normalizes the dataset by applying a logarithmic transformation with an offset.
An asymptote - or in other words a value that the data approaches but never reaches - can cause problems for polynomial fitting. This transform tries to approximate that value, then applies a log transform to the data relative to that value

Technical Details
asymptote_epsilon = mean(Y) * 1e-02
asymptote = max(Y) + asymptote_epsilon
yₙ = ln(asymptote - y)
where
Y is the dataset being transformed
mean(Y) is the average of the dataset
max(Y) is the maximum value in the dataset
asymptote_epsilon is a small buffer added to ensure all points are below the asymptote, which is important for the log transformationTrait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NormalizationTransform<T>where
T: Freeze,
impl<T> RefUnwindSafe for NormalizationTransform<T>where
T: RefUnwindSafe,
impl<T> Send for NormalizationTransform<T>
impl<T> Sync for NormalizationTransform<T>
impl<T> Unpin for NormalizationTransform<T>where
T: Unpin,
impl<T> UnsafeUnpin for NormalizationTransform<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NormalizationTransform<T>where
T: UnwindSafe,
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
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.