pub struct Pca<F> { /* private fields */ }
Expand description

Fitted Principal Component Analysis model

The model contains the mean and hyperplane for the projection of data.

Example

use linfa::traits::{Fit, Predict};
use linfa_reduction::Pca;

let dataset = linfa_datasets::iris();

// apply PCA projection along a line which maximizes the spread of the data
let embedding = Pca::params(1)
    .fit(&dataset).unwrap();

// reduce dimensionality of the dataset
let dataset = embedding.predict(dataset);

Implementations

Create default parameter set

Parameters
  • embedding_size: the target dimensionality

Return the amount of explained variance per element

Return the normalized amount of explained variance per element

Return the singular values

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 !=.

Predict something in place

Create targets that predict_inplace works with.

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

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.