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

Initializes a norm scaler that uses l2 norm

Initializes a norm scaler that uses l1 norm

Initializes a norm scaler that uses max norm

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Scales all samples in the array of shape (nsamples, nfeatures) to have unit norm.

Substitutes the records of the dataset with their scaled versions with unit norm.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.