Struct linfa_preprocessing::norm_scaling::NormScaler
source · [−]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
sourceimpl Clone for NormScaler
impl Clone for NormScaler
sourcefn clone(&self) -> NormScaler
fn clone(&self) -> NormScaler
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 Debug for NormScaler
impl Debug for NormScaler
sourceimpl PartialEq<NormScaler> for NormScaler
impl PartialEq<NormScaler> for NormScaler
sourcefn eq(&self, other: &NormScaler) -> bool
fn eq(&self, other: &NormScaler) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &NormScaler) -> bool
fn ne(&self, other: &NormScaler) -> bool
This method tests for !=.
sourceimpl<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
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 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
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 versions with unit norm.
impl Eq for NormScaler
impl StructuralEq for NormScaler
impl StructuralPartialEq for NormScaler
Auto Trait Implementations
impl RefUnwindSafe for NormScaler
impl Send for NormScaler
impl Sync for NormScaler
impl Unpin for NormScaler
impl UnwindSafe for NormScaler
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.