pub struct FittedBinarizer<F> { /* private fields */ }Expand description
A fitted Binarizer.
Binarizer is stateless — its fit (sklearn Binarizer.fit,
_data.py:2257-2278, “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 threshold, the copy
flag, and the recorded feature count. Its Transform::transform reuses the
very same strict-greater logic as the stateless Binarizer/binarize
path, so the two paths are bit-identical.
Implementations§
Source§impl<F: Float + Send + Sync + 'static> FittedBinarizer<F>
impl<F: Float + Send + Sync + 'static> FittedBinarizer<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 Binarizer.n_features_in_ (_data.py:2277).
Sourcepub fn copy(&self) -> bool
pub fn copy(&self) -> bool
Return the configured copy flag (no-op; see Binarizer::with_copy).
Trait Implementations§
Source§impl<F: Clone> Clone for FittedBinarizer<F>
impl<F: Clone> Clone for FittedBinarizer<F>
Source§fn clone(&self) -> FittedBinarizer<F>
fn clone(&self) -> FittedBinarizer<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 FittedBinarizer<F>
impl<F: Debug> Debug for FittedBinarizer<F>
Source§impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedBinarizer<F>
impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedBinarizer<F>
Source§fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Threshold each element of x, delegating to the SAME strict-greater
logic as the stateless Binarizer / binarize path.
First applies the REQ-9 check_array guards (finite / min-samples /
min-features) and binarizes, THEN validates that x has the same number
of columns recorded during Fit::fit. This ORDER matches sklearn’s
_validate_data(reset=False), which runs check_array BEFORE
_check_n_features (base.py:633 then :654, #2207): a NaN / ±inf /
zero-sample / zero-feature input raises its check_array error EVEN when
the column count is also wrong. Only after that does the n_features
comparison fire. The output is therefore byte-identical to
Binarizer::transform / binarize(x, threshold).
§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-9, via [validate_binarize_input]).
Source§type Error = FerroError
type Error = FerroError
transform.Auto Trait Implementations§
impl<F> Freeze for FittedBinarizer<F>where
F: Freeze,
impl<F> RefUnwindSafe for FittedBinarizer<F>where
F: RefUnwindSafe,
impl<F> Send for FittedBinarizer<F>where
F: Send,
impl<F> Sync for FittedBinarizer<F>where
F: Sync,
impl<F> Unpin for FittedBinarizer<F>where
F: Unpin,
impl<F> UnsafeUnpin for FittedBinarizer<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for FittedBinarizer<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.