Struct linfa_preprocessing::norm_scaling::NormScaler[][src]

pub struct NormScaler { /* fields omitted */ }
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

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

Performs the conversion.

Performs the conversion.

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.