pub struct MinMaxScaler { /* private fields */ }Expand description
A transformer that scales each item to a custom range, defaulting to [0, 1].
Implementations§
Source§impl MinMaxScaler
impl MinMaxScaler
Sourcepub fn with_scaled_range(self, min: f64, max: f64) -> Self
pub fn with_scaled_range(self, min: f64, max: f64) -> Self
Set the output range for the transformation.
Sourcepub fn with_data_range(self, min: f64, max: f64) -> Self
pub fn with_data_range(self, min: f64, max: f64) -> Self
Manually set the input range for the transformation.
This is useful if you know the input range in advance and want to avoid the overhead of fitting the scaler to the data during the initial transform, and instead want to set the input range manually.
Note that this will override any previously set (or learned) parameters.
Trait Implementations§
Source§impl Clone for MinMaxScaler
impl Clone for MinMaxScaler
Source§fn clone(&self) -> MinMaxScaler
fn clone(&self) -> MinMaxScaler
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 moreSource§impl Debug for MinMaxScaler
impl Debug for MinMaxScaler
Source§impl Default for MinMaxScaler
impl Default for MinMaxScaler
Source§impl Transformer for MinMaxScaler
impl Transformer for MinMaxScaler
Source§fn fit(&mut self, data: &[f64]) -> Result<(), Error>
fn fit(&mut self, data: &[f64]) -> Result<(), Error>
Fit the scaler to the given data.
This will compute the min and max values of the data and store them
in the params field of the scaler.
Source§fn transform(&self, data: &mut [f64]) -> Result<(), Error>
fn transform(&self, data: &mut [f64]) -> Result<(), Error>
Apply the scaler to the given data.
Source§fn inverse_transform(&self, data: &mut [f64]) -> Result<(), Error>
fn inverse_transform(&self, data: &mut [f64]) -> Result<(), Error>
Apply the inverse of the scaler to the given data.
Auto Trait Implementations§
impl Freeze for MinMaxScaler
impl RefUnwindSafe for MinMaxScaler
impl Send for MinMaxScaler
impl Sync for MinMaxScaler
impl Unpin for MinMaxScaler
impl UnsafeUnpin for MinMaxScaler
impl UnwindSafe for MinMaxScaler
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