pub struct FittedSimpleImputer<F> { /* private fields */ }Expand description
A fitted simple imputer holding one fill value per feature column.
Created by calling Fit::fit on a SimpleImputer.
Implementations§
Source§impl<F: Float + Send + Sync + 'static> FittedSimpleImputer<F>
impl<F: Float + Send + Sync + 'static> FittedSimpleImputer<F>
Sourcepub fn fill_values(&self) -> &Array1<F>
pub fn fill_values(&self) -> &Array1<F>
Return the per-input-column fill values learned during fitting.
Mirrors scikit-learn’s statistics_: entries for all-NaN columns that
are dropped under Mean/Median/MostFrequent are F::nan().
Sourcepub fn kept_indices(&self) -> &[usize]
pub fn kept_indices(&self) -> &[usize]
Return the input-column indices that survive transform, ascending.
Trait Implementations§
Source§impl<F: Clone> Clone for FittedSimpleImputer<F>
impl<F: Clone> Clone for FittedSimpleImputer<F>
Source§fn clone(&self) -> FittedSimpleImputer<F>
fn clone(&self) -> FittedSimpleImputer<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 FittedSimpleImputer<F>
impl<F: Debug> Debug for FittedSimpleImputer<F>
Source§impl<F: Float + Send + Sync + 'static> FittedPipelineTransformer<F> for FittedSimpleImputer<F>
impl<F: Float + Send + Sync + 'static> FittedPipelineTransformer<F> for FittedSimpleImputer<F>
Source§fn transform_pipeline(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform_pipeline(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Source§impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedSimpleImputer<F>
impl<F: Float + Send + Sync + 'static> Transform<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for FittedSimpleImputer<F>
Source§fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
fn transform(&self, x: &Array2<F>) -> Result<Array2<F>, FerroError>
Replace NaN values with the learned fill value, projecting onto the columns that survived fitting.
The transform input must have the same number of columns as the fit
input (the full input width, fill_values.len()), matching scikit-learn
which validates against statistics_.shape[0] (_base.py:573-577).
The OUTPUT keeps only Self::kept_indices columns, in ascending
order — dropping all-NaN columns under Mean/Median/MostFrequent
(sklearn X = X[:, valid_statistics_indexes], _base.py:586-603).
§Errors
Returns FerroError::ShapeMismatch if the number of columns does not
match the number of features seen during fitting.
Source§type Error = FerroError
type Error = FerroError
transform.Auto Trait Implementations§
impl<F> Freeze for FittedSimpleImputer<F>
impl<F> RefUnwindSafe for FittedSimpleImputer<F>where
F: RefUnwindSafe,
impl<F> Send for FittedSimpleImputer<F>where
F: Send,
impl<F> Sync for FittedSimpleImputer<F>where
F: Sync,
impl<F> Unpin for FittedSimpleImputer<F>
impl<F> UnsafeUnpin for FittedSimpleImputer<F>
impl<F> UnwindSafe for FittedSimpleImputer<F>where
F: RefUnwindSafe,
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.