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: Debug + Float> Debug for LinearScaler<F>
impl<F: Debug + Float> Debug for LinearScaler<F>
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.
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> where
F: Unpin,
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more