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§
source§impl<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
source§impl<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§
source§impl<F: Clone + Float> Clone for LinearScaler<F>
impl<F: Clone + Float> Clone for LinearScaler<F>
source§fn clone(&self) -> LinearScaler<F>
fn clone(&self) -> LinearScaler<F>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<F: PartialEq + Float> PartialEq for LinearScaler<F>
impl<F: PartialEq + Float> PartialEq for LinearScaler<F>
source§fn eq(&self, other: &LinearScaler<F>) -> bool
fn eq(&self, other: &LinearScaler<F>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<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>
source§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>
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>
source§fn 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: Eq + Float> Eq for LinearScaler<F>
impl<F: Float> StructuralEq for LinearScaler<F>
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§
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.