#[non_exhaustive]pub struct SimpleImputer { /* private fields */ }Expand description
Imputes missing (NaN) values in each feature column.
During fit, the imputer computes one fill value
per feature using the chosen Strategy. During
transform, every NaN in a column is
replaced with that value.
§Example
ⓘ
let mut imp = SimpleImputer::new().strategy(Strategy::Median);
imp.fit_transform(&mut ds)?;Implementations§
Source§impl SimpleImputer
impl SimpleImputer
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new unfitted imputer (defaults to Strategy::Mean).
Sourcepub fn fill_values(&self) -> &[f64]
pub fn fill_values(&self) -> &[f64]
Return the per-feature fill values computed during fit.
§Panics
Panics if the imputer has not been fitted.
Trait Implementations§
Source§impl Clone for SimpleImputer
impl Clone for SimpleImputer
Source§fn clone(&self) -> SimpleImputer
fn clone(&self) -> SimpleImputer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleImputer
impl Debug for SimpleImputer
Source§impl Default for SimpleImputer
impl Default for SimpleImputer
Auto Trait Implementations§
impl Freeze for SimpleImputer
impl RefUnwindSafe for SimpleImputer
impl Send for SimpleImputer
impl Sync for SimpleImputer
impl Unpin for SimpleImputer
impl UnsafeUnpin for SimpleImputer
impl UnwindSafe for SimpleImputer
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> 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 more