Struct linfa_preprocessing::whitening::FittedWhitener
source · pub struct FittedWhitener<F: Float> { /* private fields */ }Expand description
Struct that can be used to whiten data. Data will be scaled according to the whitening matrix learned during fitting. Obtained by fitting a Whitener.
Transforming the data used during fitting will yield a scaled data matrix with unit diagonal covariance matrix.
Example
use linfa::traits::{Fit, Transformer};
use linfa_preprocessing::whitening::Whitener;
// Load dataset
let dataset = linfa_datasets::diabetes();
// Learn whitening parameters
let whitener = Whitener::pca().fit(&dataset).unwrap();
// transform dataset according to whitening parameters
let dataset = whitener.transform(dataset);Implementations§
source§impl<F: Float> FittedWhitener<F>
impl<F: Float> FittedWhitener<F>
sourcepub fn transformation_matrix(&self) -> ArrayView2<'_, F>
pub fn transformation_matrix(&self) -> ArrayView2<'_, F>
The matrix used for scaling the data
sourcepub fn mean(&self) -> ArrayView1<'_, F>
pub fn mean(&self) -> ArrayView1<'_, F>
The means that will be subtracted to the features before scaling the data
Trait Implementations§
source§impl<F: Clone + Float> Clone for FittedWhitener<F>
impl<F: Clone + Float> Clone for FittedWhitener<F>
source§fn clone(&self) -> FittedWhitener<F>
fn clone(&self) -> FittedWhitener<F>
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 more