pub struct IterativeImputer { /* private fields */ }
Expand description
Iterative Imputer using the MICE (Multiple Imputation by Chained Equations) algorithm
This transformer iteratively models each feature with missing values as a function of other features. The algorithm performs multiple rounds of imputation where each feature is predicted using the other features in a round-robin fashion.
MICE is particularly useful when:
- There are multiple features with missing values
- The missing patterns are complex
- You want to model relationships between features
Implementations§
Source§impl IterativeImputer
impl IterativeImputer
Sourcepub fn new(
max_iter: usize,
tolerance: f64,
initial_strategy: ImputeStrategy,
missingvalues: f64,
alpha: f64,
) -> Self
pub fn new( max_iter: usize, tolerance: f64, initial_strategy: ImputeStrategy, missingvalues: f64, alpha: f64, ) -> Self
Creates a new IterativeImputer
§Arguments
max_iter
- Maximum number of iterationstolerance
- Convergence toleranceinitial_strategy
- Strategy for initial imputationmissingvalues
- Value representing missing dataalpha
- Regularization parameter for regression
§Returns
- A new IterativeImputer instance
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Creates an IterativeImputer with default parameters
Uses 10 iterations, 1e-3 tolerance, mean initial strategy, NaN missing values, and 1e-6 regularization.
Sourcepub fn with_max_iter(_maxiter: usize) -> Self
pub fn with_max_iter(_maxiter: usize) -> Self
Creates an IterativeImputer with specified max iterations and defaults for other parameters
Sourcepub fn with_random_seed(self, seed: u64) -> Self
pub fn with_random_seed(self, seed: u64) -> Self
Set the random seed for reproducible results
Sourcepub fn with_alpha(self, alpha: f64) -> Self
pub fn with_alpha(self, alpha: f64) -> Self
Set the regularization parameter
Sourcepub fn with_min_improvement(self, minimprovement: f64) -> Self
pub fn with_min_improvement(self, minimprovement: f64) -> Self
Set the minimum improvement threshold
Auto Trait Implementations§
impl Freeze for IterativeImputer
impl RefUnwindSafe for IterativeImputer
impl Send for IterativeImputer
impl Sync for IterativeImputer
impl Unpin for IterativeImputer
impl UnwindSafe for IterativeImputer
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> 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 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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.