pub struct StandardScaleParams {
pub mean: f64,
pub std_dev: f64,
}Expand description
Parameters for the standard scaler.
Fields§
§mean: f64The mean of the data.
std_dev: f64The standard deviation of the data.
Implementations§
Source§impl StandardScaleParams
impl StandardScaleParams
Sourcepub fn new(mean: f64, std_dev: f64) -> Self
pub fn new(mean: f64, std_dev: f64) -> Self
Create a new StandardScaleParams with the given mean and standard deviation.
Sourcepub fn from_data<T>(data: T) -> Self
pub fn from_data<T>(data: T) -> Self
Create a new StandardScaleParams from the given data.
Note: this uses Welford’s online algorithm to compute mean and variance in a single pass, since we only have an iterator. The standard deviation is calculated using the biased estimator, for parity with the scikit-learn implementation.
Sourcepub fn from_data_ignoring_nans<T: Iterator<Item = f64>>(data: T) -> Self
pub fn from_data_ignoring_nans<T: Iterator<Item = f64>>(data: T) -> Self
Create a new StandardScaleParams from the given data, ignoring NaN values.
This is useful if you have NaN values in your data and want to avoid propagating them during the standardization process.
See StandardScaleParams::from_data for more details on the implementation.
Trait Implementations§
Source§impl Clone for StandardScaleParams
impl Clone for StandardScaleParams
Source§fn clone(&self) -> StandardScaleParams
fn clone(&self) -> StandardScaleParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StandardScaleParams
impl RefUnwindSafe for StandardScaleParams
impl Send for StandardScaleParams
impl Sync for StandardScaleParams
impl Unpin for StandardScaleParams
impl UnsafeUnpin for StandardScaleParams
impl UnwindSafe for StandardScaleParams
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