Struct linfa_preprocessing::linear_scaling::LinearScaler  
source · [−]pub struct LinearScaler<F: Float> { /* private fields */ }Expand description
The result of fitting a linear scaler. Scales datasets with the parameters learned during fitting.
Implementations
sourceimpl<F: Float> LinearScaler<F>
 
impl<F: Float> LinearScaler<F>
sourcepub fn standard() -> LinearScalerParams<F>
 
pub fn standard() -> LinearScalerParams<F>
Initializes a Standard scaler
sourcepub fn standard_no_mean() -> LinearScalerParams<F>
 
pub fn standard_no_mean() -> LinearScalerParams<F>
Initializes a Standard scaler that does not subract the mean to the features
sourcepub fn standard_no_std() -> LinearScalerParams<F>
 
pub fn standard_no_std() -> LinearScalerParams<F>
Initializes a Stadard scaler that does not scale the features by the inverse of the standard deviation
sourcepub fn min_max() -> LinearScalerParams<F>
 
pub fn min_max() -> LinearScalerParams<F>
Initializes a MinMax scaler with range 0..=1
sourcepub fn min_max_range(min: F, max: F) -> LinearScalerParams<F>
 
pub fn min_max_range(min: F, max: F) -> LinearScalerParams<F>
Initializes a MinMax scaler with the specified minimum and maximum values for the range.
If min is bigger than max then fitting will return an error on any input.
sourcepub fn max_abs() -> LinearScalerParams<F>
 
pub fn max_abs() -> LinearScalerParams<F>
Initializes a MaxAbs scaler
sourceimpl<F: Float> LinearScaler<F>
 
impl<F: Float> LinearScaler<F>
sourcepub fn offsets(&self) -> &Array1<F>
 
pub fn offsets(&self) -> &Array1<F>
Array of size n_features that contains the offset that will be subtracted to each feature
sourcepub fn scales(&self) -> &Array1<F>
 
pub fn scales(&self) -> &Array1<F>
Array of size n_features that contains the scale that will be applied to each feature
sourcepub fn method(&self) -> &ScalingMethod<F>
 
pub fn method(&self) -> &ScalingMethod<F>
Returns the method used for fitting. Useful for printing, since ScalingMethod implements Display
Trait Implementations
sourceimpl<F: Clone + Float> Clone for LinearScaler<F>
 
impl<F: Clone + Float> Clone for LinearScaler<F>
sourcefn clone(&self) -> LinearScaler<F>
 
fn clone(&self) -> LinearScaler<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<F: Debug + Float> Debug for LinearScaler<F>
 
impl<F: Debug + Float> Debug for LinearScaler<F>
sourceimpl<F: PartialEq + Float> PartialEq<LinearScaler<F>> for LinearScaler<F>
 
impl<F: PartialEq + Float> PartialEq<LinearScaler<F>> for LinearScaler<F>
sourcefn eq(&self, other: &LinearScaler<F>) -> bool
 
fn eq(&self, other: &LinearScaler<F>) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &LinearScaler<F>) -> bool
 
fn ne(&self, other: &LinearScaler<F>) -> bool
This method tests for !=.
sourceimpl<F: Float> Transformer<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for LinearScaler<F>
 
impl<F: Float> Transformer<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for LinearScaler<F>
sourceimpl<F: Float, D: Data<Elem = F>, T: AsTargets> Transformer<DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>> for LinearScaler<F>
 
impl<F: Float, D: Data<Elem = F>, T: AsTargets> Transformer<DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>, DatasetBase<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, T>> for LinearScaler<F>
sourcefn transform(
    &self, 
    x: DatasetBase<ArrayBase<D, Ix2>, T>
) -> DatasetBase<Array2<F>, T>
 
fn transform(
    &self, 
    x: DatasetBase<ArrayBase<D, Ix2>, T>
) -> DatasetBase<Array2<F>, T>
Substitutes the records of the dataset with their scaled version. Panics if the shape of the records is not compatible with the shape of the dataset used for fitting.
impl<F: Float> StructuralPartialEq for LinearScaler<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for LinearScaler<F> where
    F: RefUnwindSafe, 
impl<F> Send for LinearScaler<F>
impl<F> Sync for LinearScaler<F>
impl<F> Unpin for LinearScaler<F>
impl<F> UnwindSafe for LinearScaler<F> where
    F: UnwindSafe + RefUnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more