pub struct ConstantImputer { /* private fields */ }Expand description
Replaces NaN values with a constant.
This transformer accepts NaN in its input, unlike most other
transformers. The fill value must be finite.
Implementations§
Source§impl ConstantImputer
impl ConstantImputer
Sourcepub fn new(feature_count: usize) -> Result<Self, RillError>
pub fn new(feature_count: usize) -> Result<Self, RillError>
Create a new imputer for feature_count features with default config.
§Errors
Returns RillError::EmptyFeatures if feature_count is 0.
Sourcepub fn with_config(
feature_count: usize,
config: ConstantImputerConfig,
) -> Result<Self, RillError>
pub fn with_config( feature_count: usize, config: ConstantImputerConfig, ) -> Result<Self, RillError>
Create a new imputer with a custom configuration.
§Errors
Returns RillError::EmptyFeatures if feature_count is 0.
Returns RillError::NonFiniteValue if fill_value is not finite.
Sourcepub fn fill_value(&self) -> f64
pub fn fill_value(&self) -> f64
The fill value used to replace NaN.
Trait Implementations§
Source§impl Clone for ConstantImputer
impl Clone for ConstantImputer
Source§fn clone(&self) -> ConstantImputer
fn clone(&self) -> ConstantImputer
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 ConstantImputer
impl Debug for ConstantImputer
Source§impl Transformer for ConstantImputer
impl Transformer for ConstantImputer
Source§fn output_dim(&self) -> usize
fn output_dim(&self) -> usize
Number of features produced by
transform.Source§fn transform(&self, features: &[f64]) -> Result<Vec<f64>, RillError>
fn transform(&self, features: &[f64]) -> Result<Vec<f64>, RillError>
Transform features using the current internal state.
Source§fn update(&mut self, features: &[f64]) -> Result<(), RillError>
fn update(&mut self, features: &[f64]) -> Result<(), RillError>
Update internal statistics using raw features.
Source§fn samples_seen(&self) -> u64
fn samples_seen(&self) -> u64
How many samples the transformer has seen.
Auto Trait Implementations§
impl Freeze for ConstantImputer
impl RefUnwindSafe for ConstantImputer
impl Send for ConstantImputer
impl Sync for ConstantImputer
impl Unpin for ConstantImputer
impl UnsafeUnpin for ConstantImputer
impl UnwindSafe for ConstantImputer
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