Struct linfa_reduction::pca::Pca [−][src]
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); // reduce dimensionality of the dataset let dataset = embedding.predict(dataset);
Implementations
impl Pca<f64>[src]
pub fn params(embedding_size: usize) -> PcaParams[src]
pub fn explained_variance(&self) -> Array1<f64>[src]
Return the amount of explained variance per element
pub fn explained_variance_ratio(&self) -> Array1<f64>[src]
Return the normalized amount of explained variance per element
pub fn singular_values(&self) -> &Array1<f64>[src]
Return the singular values
Trait Implementations
impl<F: Clone> Clone for Pca<F>[src]
impl<F: Debug> Debug for Pca<F>[src]
impl<F: Float, D: Data<Elem = F>> PredictRef<ArrayBase<D, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>> for Pca<F>[src]
fn predict_ref<'a>(&'a self, records: &ArrayBase<D, Ix2>) -> Array2<F>[src]
Auto Trait Implementations
impl<F> RefUnwindSafe for Pca<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for Pca<F> where
F: Send,
F: Send,
impl<F> Sync for Pca<F> where
F: Sync,
F: Sync,
impl<F> Unpin for Pca<F>
impl<F> UnwindSafe for Pca<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<'a, F, D, T, O> Predict<&'a ArrayBase<D, Dim<[usize; 2]>>, T> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>, [src]
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
impl<'a, F, R, T, S, O> Predict<&'a DatasetBase<R, T>, S> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>, [src]
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
pub fn predict(&self, ds: &'a DatasetBase<R, T>) -> S[src]
impl<F, D, T, O> Predict<ArrayBase<D, Dim<[usize; 2]>>, DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>> for O where
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>, [src]
F: Float,
D: Data<Elem = F>,
O: PredictRef<ArrayBase<D, Dim<[usize; 2]>>, T>,
pub fn predict(
&self,
records: ArrayBase<D, Dim<[usize; 2]>>
) -> DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>[src]
&self,
records: ArrayBase<D, Dim<[usize; 2]>>
) -> DatasetBase<ArrayBase<D, Dim<[usize; 2]>>, T>
impl<F, R, T, S, O> Predict<DatasetBase<R, T>, DatasetBase<R, S>> for O where
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>, [src]
F: Float,
R: Records<Elem = F>,
O: PredictRef<R, S>,
pub fn predict(&self, ds: DatasetBase<R, T>) -> DatasetBase<R, S>[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,