pub struct NormScaler { /* private fields */ }
Expand description
Norm scaler: scales all samples in a dataset to have unit norm, according to the specified norm measure
§Example
use linfa::traits::Transformer;
use linfa_preprocessing::norm_scaling::NormScaler;
// Load dataset
let dataset = linfa_datasets::diabetes();
// Initialize scaler
let scaler = NormScaler::l2();
// Scale dataset
let dataset = scaler.transform(dataset);
Implementations§
Trait Implementations§
Source§impl Clone for NormScaler
impl Clone for NormScaler
Source§fn clone(&self) -> NormScaler
fn clone(&self) -> NormScaler
Returns a copy 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 NormScaler
impl Debug for NormScaler
Source§impl PartialEq for NormScaler
impl PartialEq for NormScaler
Source§impl<F: Float> Transformer<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for NormScaler
impl<F: Float> Transformer<ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for NormScaler
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 NormScaler
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 NormScaler
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 versions with unit norm.
impl Eq for NormScaler
impl StructuralPartialEq for NormScaler
Auto Trait Implementations§
impl Freeze for NormScaler
impl RefUnwindSafe for NormScaler
impl Send for NormScaler
impl Sync for NormScaler
impl Unpin for NormScaler
impl UnwindSafe for NormScaler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more