pub struct ForwardFill { /* private fields */ }Expand description
Replaces NaN values with the last observed non-NaN value.
This transformer accepts NaN in its input. When no value has
been seen for a feature, 0.0 is used as the fill value.
Implementations§
Source§impl ForwardFill
impl ForwardFill
Sourcepub fn new(feature_count: usize) -> Result<Self, RillError>
pub fn new(feature_count: usize) -> Result<Self, RillError>
Create a new forward-fill imputer for feature_count features.
§Errors
Returns RillError::EmptyFeatures if feature_count is 0.
Sourcepub fn last_values(&self) -> &[Option<f64>]
pub fn last_values(&self) -> &[Option<f64>]
The per-feature last observed non-NaN values (None if unseen).
Trait Implementations§
Source§impl Clone for ForwardFill
impl Clone for ForwardFill
Source§fn clone(&self) -> ForwardFill
fn clone(&self) -> ForwardFill
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 ForwardFill
impl Debug for ForwardFill
Source§impl Transformer for ForwardFill
impl Transformer for ForwardFill
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 ForwardFill
impl RefUnwindSafe for ForwardFill
impl Send for ForwardFill
impl Sync for ForwardFill
impl Unpin for ForwardFill
impl UnsafeUnpin for ForwardFill
impl UnwindSafe for ForwardFill
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