Struct smartcore::decomposition::pca::PCA
source · pub struct PCA<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> { /* private fields */ }
Expand description
Principal components analysis algorithm
Implementations§
source§impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> PCA<T, X>
impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> PCA<T, X>
sourcepub fn fit(data: &X, parameters: PCAParameters) -> Result<PCA<T, X>, Failed>
pub fn fit(data: &X, parameters: PCAParameters) -> Result<PCA<T, X>, Failed>
Fits PCA to your data.
data
- NxM matrix with N observations and M features in each observation.n_components
- number of components to keep.parameters
- other parameters, useDefault::default()
to set parameters to default values.
sourcepub fn transform(&self, x: &X) -> Result<X, Failed>
pub fn transform(&self, x: &X) -> Result<X, Failed>
Run dimensionality reduction for x
x
- KxM data where K is number of observations and M is number of features.
sourcepub fn components(&self) -> &X
pub fn components(&self) -> &X
Get a projection matrix
Trait Implementations§
source§impl<T: Debug + Number + RealNumber, X: Debug + Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> Debug for PCA<T, X>
impl<T: Debug + Number + RealNumber, X: Debug + Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> Debug for PCA<T, X>
source§impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> PartialEq<PCA<T, X>> for PCA<T, X>
impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> PartialEq<PCA<T, X>> for PCA<T, X>
source§impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> Transformer<X> for PCA<T, X>
impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> Transformer<X> for PCA<T, X>
source§impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> UnsupervisedEstimator<X, PCAParameters> for PCA<T, X>
impl<T: Number + RealNumber, X: Array2<T> + SVDDecomposable<T> + EVDDecomposable<T>> UnsupervisedEstimator<X, PCAParameters> for PCA<T, X>
Auto Trait Implementations§
impl<T, X> RefUnwindSafe for PCA<T, X>where T: RefUnwindSafe, X: RefUnwindSafe,
impl<T, X> Send for PCA<T, X>where T: Send, X: Send,
impl<T, X> Sync for PCA<T, X>where T: Sync, X: Sync,
impl<T, X> Unpin for PCA<T, X>where T: Unpin, X: Unpin,
impl<T, X> UnwindSafe for PCA<T, X>where T: UnwindSafe, X: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more