pub struct FittedNormalizer<F> { /* private fields */ }Expand description
A fitted Normalizer.
Normalizer is stateless — its fit (sklearn Normalizer.fit,
_data.py:2062-2083, “Only validates estimator’s parameters”) learns NO
statistics; it merely validates the input and records n_features_in_. The
fitted type therefore carries only the configured norm, the copy flag,
and the recorded feature count. Its Transform::transform reuses the very
same row-norm logic as the stateless Normalizer/normalize path, so
the two paths are bit-identical.
Implementations§
Source§impl<F: Float + Send + Sync + 'static> FittedNormalizer<F>
impl<F: Float + Send + Sync + 'static> FittedNormalizer<F>
Sourcepub fn n_features_in(&self) -> usize
pub fn n_features_in(&self) -> usize
Return the number of features (columns) seen during Fit::fit.
Mirrors scikit-learn’s Normalizer.n_features_in_ (_data.py:2082).
Sourcepub fn copy(&self) -> bool
pub fn copy(&self) -> bool
Return the configured copy flag (no-op; see Normalizer::with_copy).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedNormalizer<F>
impl<F: Clone> Clone for FittedNormalizer<F>
Source§fn clone(&self) -> FittedNormalizer<F>
fn clone(&self) -> FittedNormalizer<F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for FittedNormalizer<F>
impl<F: Debug> Debug for FittedNormalizer<F>
Source§impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedNormalizer<F>
impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedNormalizer<F>
Source§fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Normalize each row of x to unit norm, delegating to the SAME row-norm
logic as the stateless Normalizer / normalize path.
First validates that x has the same number of columns recorded during
Fit::fit (sklearn _validate_data(reset=False),
sklearn/preprocessing/_data.py:2104) and applies the REQ-2
check_array guards, then calls the shared normalize free function
with axis=1 (sklearn Normalizer.transform ->
normalize(X, norm=self.norm, axis=1), :2106). The output is therefore
byte-identical to Normalizer::transform.
§Errors
Returns FerroError::ShapeMismatch if the column count differs from
n_features_in_. Returns FerroError::InsufficientSamples for zero
rows and FerroError::InvalidParameter for zero features or any
non-finite value (REQ-2, via normalize).
Source§type Error = FerroError
type Error = FerroError
transform.Auto Trait Implementations§
impl<F> Freeze for FittedNormalizer<F>
impl<F> RefUnwindSafe for FittedNormalizer<F>where
F: RefUnwindSafe,
impl<F> Send for FittedNormalizer<F>where
F: Send,
impl<F> Sync for FittedNormalizer<F>where
F: Sync,
impl<F> Unpin for FittedNormalizer<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedNormalizer<F>
impl<F> UnwindSafe for FittedNormalizer<F>where
F: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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.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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.